function myEventHandler(arg1, arg2,...) {
var evt = window.event || function(cx) {
if(typeof Event!='undefined' && cx){
for(var ii=0; ii<cx.arguments.length; ii++)
if(cx.arguments[ii] instanceof Event) return cx.arguments[ii];
return arguments.callee(cx.caller);
}
return null;
}(arguments.callee.caller);
evt.preventDefault=evt.preventDefault||function(){evt.returnValue = false;};
evt.stopPropagation=evt.stopPropagation||function(){evt.cancelBubble = false;};
}
This is a template for defining javascript event handler with additional parameters support and stopPropagation/preventDefault handling.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.