var EventUtil = new Object;
EventUtil.addEvent = function (oTarget, sEventType, fnHandler) {
if (oTarget.addEventListener) {
oTarget.addEventListener(sEventType, fnHandler, false);
} else if (oTarget.attachEvent) {
oTarget.attachEvent("on" + sEventType, fnHandler);
} else {
oTarget["on" + sEventType] = fnHandler;
}
};
作者:kingwolf_JavaScript 发表于2012-5-15 19:12:15
原文链接