Created
January 16, 2014 04:46
-
-
Save iamnewton/8449931 to your computer and use it in GitHub Desktop.
Retrieves a list of all possible DOM events and populates an array. Works in IE9+, Chrome, Safari & Firefox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object | |
.getOwnPropertyNames( document ) | |
.concat( | |
Object.getOwnPropertyNames( | |
Object.getPrototypeOf( | |
Object.getPrototypeOf( document ) | |
) | |
) | |
) | |
.concat( | |
Object.getOwnPropertyNames( | |
Object.getPrototypeOf( window ) | |
) | |
) | |
.filter( function( i ) { | |
return ! i.indexOf( 'on' ) && ( document[i] == null || typeof document[i] == 'function' ); | |
}) | |
.filter( function( elem, pos, self ) { | |
return self.indexOf( elem ) == pos; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment