var evenTutil={
//添加句柄
addHandler:function(element,type,handler){
if(element.addEventListener){
element.addEventListener(type,handler,false);
}else if(element.attachEvent){
element.attachEvent("on"+type,handler);
}else{
element['on'+type]=handler;
//element['on'+type等于element."on"+type,但element."on"+type语法是错误的!
}
}
removeHandler:function(element,type,handler){
if(element.removeEventListener){
element.removeEventListener(type,handler,false);
}else if(element.detachEvent){
element.detachEvent("on"+type,handler);
}else{
element['on'+type]=handler;
}
}
}
element['on'+type]='null'
removeHandler:function(element,type,handler){ if(element.removeEventListener){ element.removeEventListener(type,handler,false); }else if(element.detachEvent){ element.detachEvent("on"+type,handler); }else{ element['on'+type]=handler;//这句换成element['on'+type]=null; } }
最后一句应该是等于null吧