如何看到什么确切事件绑定到DOM元素? [英] How to see what exact events are bound to DOM elements?

查看:141
本文介绍了如何看到什么确切事件绑定到DOM元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得我想经常这样做,但不能因为我无法访问实际的事件。



例如(这只是一个例如,我可以只是看看API)我试图看看stackoverflow的图像上传器是如何工作的,但是当我调用 $($ 0).data('events)(或 $('form [action =/ upload / image]:submit')。data('events'))我得到未定义。有没有其他方法来查看某些事件的实际功能?



如果是,还有一种方法可以在这些事件上设置断点?



编辑:



使用 Visual Event 这是我看到的p>

解决方案

个人而言,我使用的是Firebug和视觉事件



编辑:事件亮点并不总是完美排列,因为定位。



我设法在这里找到图像提交功能:


I feel I want to do this often but can't because I don't have access to the actual events.

For example (and this is just an example as I can just look at the API instead) I was trying to see how stackoverflow's image uploader works, but when I call $($0).data('events) (or $('form[action="/upload/image"] :submit').data('events') ) I get undefined. Is there any other way to look at the actual functions of certain events?

If so, is there also a way to set breakpoints on those events?

EDIT:

Using Visual Event this is what I see

解决方案

Personally, I use a mix of Firebug and Visual Event.

EDIT: The event highlights don't always line up perfectly due to positioning.

I managed to find the image submit function here:

这篇关于如何看到什么确切事件绑定到DOM元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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