什么事件被绑定? [英] what events are bound?

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

问题描述

解决方案

如果您正在使用Safari或Chrome,您可以打开开发工具并检查元素(通过点击放大镜)。在右边的事件侦听器选项卡中,它将告诉您绑定的事件与该元素的功能和位置。



或通过代码执行此操作:

  $('selector')。 // get 
console.dir($('selector')。data('events')); //在firefox firebug或webkit的开发工具中显示


Is there any way to see what events are bound to an element with jQuery?

解决方案

If you are using Safari or Chrome, you can open up the Developer Tools and inspect the element (by clicking the magnifying glass). In the Event Listeners tab on the right it will tell you the binded events to that element, with their functions and locations.

OR to do this via code:

$('selector').data('events'); // get
console.dir($('selector').data('events')); // display in firefox firebug or webkit's developer tools

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

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