event.js - AJAX Search Code ~ Ajax Training, Learn Ajax Video Tutorials Online, Ajax Examples
Ajax Training, Learn Ajax Video Tutorials Online, Ajax Examples: event.js - AJAX Search Code

event.js - AJAX Search Code

var Event = {
get: function(e) {
return window.event ? window.event : e;
},
getTarget: function(e) {
return e.target || e.srcElement;
},
add: function(obj, evt, fnc, capture) {
if (obj.addEventListener) {
obj.addEventListener(evt, fnc, capture);
return true;
} else if (obj.attachEvent) {
return obj.attachEvent('on' + evt, fnc);
} else {
obj['on' + evt] = fnc;
}
},
remove: function(obj, evt, fnc, capture) {
if (obj.removeEventListener) {
obj.removeEventListener(evt, fnc, capture);
} else if (obj.detachEvent) {
obj.detachEvent('on' + evt, fnc);
} else {
obj['on' + evt] = null;
}
},
addOnLoad: function(fnc) {
var oldOnLoad = window.onload;
if (typeof window.onload != 'function') {
window.onload = fnc;
} else {
window.onload = function() {
oldOnLoad();
fnc();
}
}
}
};

Related Posts by Categories

0 comments:

Useful Links on Adobe Flex

Your Ad Here

Latest Books on Adobe Flex