In modern versions of jQuery, you would use the $._data
method to find any events attached by jQuery to the element in question.(在现代版本的jQuery中,您将使用$._data
方法查找jQuery附加到相关元素的任何事件。)
Note , this is an internal-use only method:(注意 ,这是仅供内部使用的方法:)
// Bind up a couple of event handlers
$("#foo").on({
click: function(){ alert("Hello") },
mouseout: function(){ alert("World") }
});
// Lookup events for this particular Element
$._data( $("#foo")[0], "events" );
The result from $._data
will be an object that contains both of the events we set (pictured below with the mouseout
property expanded):($._data
的结果将是一个包含我们设置的两个事件的对象(如下图所示,其中的mouseout
属性已展开):)
Then in Chrome, you may right click the handler function and click "view function definition" to show you the exact spot where it is defined in your code.(然后,在Chrome中,您可以右键单击处理函数,然后单击“查看函数定义”,以向您显示在代码中定义的确切位置。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…