JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书:

17.2.4 attachEvent()

document.removeEventListener("mousemove", handleMouseMove, true); document.removeEventListener("mouseup", handleMouseUp, true);


17.2.4 attachEvent()

Internet Explorer, prior to IE9, does not support addEventListener() and removeEventListener(). In IE5 and later, it defines similar methods attachEvent() and detachEvent().

The attachEvent() and detachEvent() methods work like addEventListener() and removeEventListener(), with the following exceptions:

17.2 Registering Event Handlers | 459

It is common to see event handler registration code that uses addEventListener() in browsers that support it and otherwise uses attachEvent():

var b = document.getElementById("mybutton");

var handler = function() { alert("Thanks!"); };

if (b.addEventListener)

b.addEventListener("click", handler, false);

else if (b.attachEvent)

b.attachEvent("onclick", handler);

欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/28316.html
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1