IE浏览器中事件对象是window对象的一个属性event

oP.onclick=function(){

var oEvent = window.event;

}

DOM中规定event对象必须作为唯一的参数传给事件处理函数

oP.onclick = function(OEvent){

//.....

}


因此为了兼容,通常采用下面的方法:

oP.onclick = function(oEvent){

if(window.event){
oEvent = window.event;
}
   //.......

}




相关文章:

  • 2022-12-23
  • 2022-01-01
  • 2021-05-13
  • 2022-12-23
  • 2020-03-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-02
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-06-25
相关资源
相似解决方案