单addHandler那段可以起作用,加了remove就不行了,提示说remove那句 Uncaught SyntaxError: Unexpected identifier
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;
}
}
}