为什么我的ie9好像支持addEventListener?
function addEvent(ele,type,hander){
// 执行代码
if(ele.addEventListener){
ele.addEventListener(type,hander,false);
}
/*
if(ele.attachEvent){
ele.attachEvent('on'+type,hander);
}
else{
ele['on'+type]=hander;
}
*/
}
function addEvent(ele,type,hander){
// 执行代码
if(ele.addEventListener){
ele.addEventListener(type,hander,false);
}
/*
if(ele.attachEvent){
ele.attachEvent('on'+type,hander);
}
else{
ele['on'+type]=hander;
}
*/
}
2015-07-17
举报