Skip to content

Instantly share code, notes, and snippets.

@rwaldron

rwaldron/1414.js Secret

Created January 6, 2011 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwaldron/877c36fa541d01afd022 to your computer and use it in GitHub Desktop.
Save rwaldron/877c36fa541d01afd022 to your computer and use it in GitHub Desktop.
// Adapted from: http://stackoverflow.com/q/4465028/172322
//
var globalHandler = jQuery.expando + targetType;
window[ globalHandler ] = function( target ) {
method = document.createElement( target.nodeName )[ targetType ];
method.call( target );
};
window[ globalHandler ]( target );
delete window[ globalHandler ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment