Difference between revisions of "User:Trias/common.js"

From SpiralKnights

Jump to: navigation, search
(Created page with 'window.killEvt = function( evt ) { evt = evt || window.event || window.Event; // W3C, IE, Netscape if ( typeof ( evt.preventDefault ) != 'undefined' ) { evt.preventDefault();…')
 
Line 1: Line 1:
 
window.killEvt = function( evt ) {
 
window.killEvt = function( evt ) {
 +
        window.alert("event should cancel");
 
evt = evt || window.event || window.Event; // W3C, IE, Netscape
 
evt = evt || window.event || window.Event; // W3C, IE, Netscape
 
if ( typeof ( evt.preventDefault ) != 'undefined' ) {
 
if ( typeof ( evt.preventDefault ) != 'undefined' ) {

Revision as of 09:31, 24 August 2011

window.killEvt = function( evt ) {
        window.alert("event should cancel");
	evt = evt || window.event || window.Event; // W3C, IE, Netscape
	if ( typeof ( evt.preventDefault ) != 'undefined' ) {
		evt.preventDefault(); // Don't follow the link
		evt.stopPropagation();
	} else {
		evt.cancelBubble = true; // IE
	}
	return false; // Don't follow the link (IE)
}
Personal tools