关于event的问题以及获取event的函数代码问题

问题1.


 button1.onclick = function(){alert("hello")}

button1.onclick = function(event){alert("hello")}

有什么区别?

问题2.关于EventUtil中的一个函数

 getEvent:function(event){ //这个event看不懂
   return event ?event:window.event;    //  这句话看得懂
}
bt1.onclick = function(event){       //这个是使用上面的函数 这个event在ie中能识别吗?
event = EventUtil.getEvent(event)
}

传进去的参数event是什么 不是说在ie在使用dom0添加事件处理函数时,event对象作为window对象的一个属性存在在,是不是可以理解为ie在使用dom0添加事件处理函数时不能识别event 是能识别window.event,如果是这样bt1.onclick = function(event)这个event是识别不了的 应该写成bt1.onclick = function(window.event){.....}

1,没有区别,只是第二个到了个参数event,第一个也可以使用arguments[0]获取到事件参数

2,IE8-事件对象存储在window对象中。这个是浏览器对js支持有关。标准浏览器将事件参数作为第一个参数传入,ie8-只存储于window中。所以需要做兼容,如果参数evnet不存在(IE8-)再从window对象中获取