使用jquery获取所有绑定的事件 [英] Fetch all binded events using jquery

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

问题描述

我有一个庞大的代码库中的一个组件。在我绑定任何事件或做任何事情之前,我想获取该组件的所有当前绑定的事件。



jquery提供了一种方法来获取所有当前绑定的事件组件?



任何帮助都不胜感激。



干杯

解决方案

jQuery将绑定的事件存储在jQuery的特殊数据函数中。



尝试这个:

  var events = $('div')。data('events'); 


I have a component in a vast codebase. Before I bind any events or do anything I want to fetch all the currently bound events for that components.

Does jquery provide a way to fetch all the currently bound events for a component?

Any help is appreciated.

Cheers

解决方案

jQuery stores the bound events in the special data functions of jQuery.

Try this out:

var events = $('div').data('events');

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

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