使用jquery获取所有绑定的事件 [英] Fetch all binded events using jquery
本文介绍了使用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屋!
查看全文