简体   繁体   English

如何在chrome dev工具中通过Jquery获取元素集的事件监听器?

[英]How to get event listener of element set through Jquery in chrome dev tool?

I tried to search but not found exact solution. 我试图搜索但没找到确切的解决方案。

If a div element has onclick event listener set by jquery than how to get value/function triggered on click in chrome dev tool? 如果div元素具有由jquery设置的onclick事件侦听器,而不是如何在chrome dev工具中单击时触发值/函数?

I try in dev tool but it is only showing 'content js min.js:1'. 我尝试使用开发工具,但它只显示'content js min.js:1'。

Please see this image http://myfilestore.tk/net/Capture.PNG?a=so14052013 请看这个图像http://myfilestore.tk/net/Capture.PNG?a=so14052013

Looks like what you want is to see the click event handlers registered for an element. 看起来你想要的是看到为元素注册的click事件处理程序。

You can use event data to achieve this in the console, though you have to note that it is private method - not documented may get changed in future without any notification 您可以使用事件数据在控制台中实现此目的,但您必须注意它是私有方法 - 未记录的文档可能会在未经任何通知的情况下进行更改

Ex: 例如:

var clicks = jQuery._data( jQuery('element')[0] , "events" ).click;

Read this question also 也阅读这个问题

Demo: Fiddle 演示: 小提琴

The jQuery Audit plugin plugin should do the trick. jQuery Audit插件插件应该可以解决问题。 It's not perfect, but it should give you what you want. 它并不完美,但应该能满足你的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM