在Internet Explorer页面上捕获Web对象并使用鼠标单击列出其属性 [英] Capture Web Object on an Internet Explorer Page and list its properties by using Mouse Click

查看:76
本文介绍了在Internet Explorer页面上捕获Web对象并使用鼠标单击列出其属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我需要帮助开发一个工具,可以帮助我在Web浏览器上捕获HTML页面上的任何对象,并使用简单鼠标单击列出其属性。我有点想象一个具有以下步骤的解决方案。



1)使用鼠标单击以识别它单击的Windows句柄。

2)验证该句柄的应用程序是Internet Explorer。

3)验证后将Handle分配给Window对象。

4)使用HTML文档对象功能提取和识别鼠标点击的对象。



但我在执行第3步和第4步时感到困惑,因为我无法从Handle获取Window对象。有人可以请你进一步帮助我。



谢谢



Bharath

Hi I need help developing a tool that can help me capture any objects on a HTML Page on a web browser and list its Properties by using Simple Mouse Click. I kind of imagined a solution with the following steps.

1) Using Mouse click to identify the Handle of Windows it clicked.
2) Validate the Application of that Handle is Internet Explorer.
3) After Validating assign the Handle to a Window object.
4) Use HTML Document Object functionality to extract and identify the Object clicked by Mouse.

but I am confused while performing step 3 & 4 because i am not able to get a Window object from the Handle. Can someone please assist me further.

Thanks

Bharath

推荐答案

在网页上呈现的对象不是窗口,也没有句柄。目前尚不清楚你指的是什么对象,但即使某些窗口(在Windows API和窗口句柄的意义上)可能用于实现Web浏览器,它也与ASP.NET应用程序无关。那些窗口与你提到的DOM对象无关。客户端不必在Windows操作系统上执行,它可以是任何东西,没有窗口句柄的概念。



整个想法使得没有任何意义。



您可以使用JavaScript识别您单击的对象。获取DOM对象的一种明显方法是函数 document.getElementById()

http://www.w3schools.com/jsref/met_document_getelementbyid.asp [ ^ ]。



您可以使用括号遍历某些JavaScript对象的所有属性(在中使用为......编制索引。请参阅:

https://developer.mozilla.org / en-US / docs / Web / JavaScript / Guide / Working_with_Objects [ ^ ]。



另请参阅:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty [ ^ ]。



-SA
Objects rendered on a Web page are not windows and don't have handles. It's not clear what objects do you mean, but even though some windows (in the sense of Windows API and window handles) may be used for implementation of a Web browser, it has nothing to do with your ASP.NET application. Those windows have nothing to do with DOM objects you mentioned. And the client side does not have to be executed on a Windows OS, it can be anything, where there is no a concept of windows handles.

The whole idea makes no sense at all.

You can identify the objects you click using JavaScript. One apparent way to get a DOM object is the function document.getElementById():
http://www.w3schools.com/jsref/met_document_getelementbyid.asp[^].

You can traverse through all properties of some JavaScript object using bracket ("indexing") notation with for… in. Please see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects[^].

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty[^].

—SA


这篇关于在Internet Explorer页面上捕获Web对象并使用鼠标单击列出其属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆