问题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){.....}