0

I am wondering if there is a way to get a list of the currently addedtostage events in JavaScript without jQuery?

I want to know this because I want to remove these events later.

I looked around on stackoverflow but I couldn't find an answer without jQuery.

I tried:

Event.observers.each(function(item) {
   if(item[0] == element) {
      console.log(item[2])
   }
});

I also looked at List all javascript events wired up on a page using jquery

Thanks

4

1 に答える 1

1

私が知る限り、eventListenerList は DOM 3 に含まれていないため、js でネイティブに実際に行う方法はまだありません。

デバッグのためだけの場合は、視覚的なイベント (http://www.sprymedia.co.uk/article/Visual+Event ) などのツールを使用できます。これは、主要なライブラリがイベントをサブスクライブする方法とその読み取り方法を知っています。

于 2012-07-19T07:43:25.197 に答える