事件侦听器vs事件处理程序 [英] Event listener vs event handler
本文介绍了事件侦听器vs事件处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
onclick =callFunction();
?还是应该使用事件监听器?如果是,他们如何工作?解决方案
阅读:
http://www.quirksmode.org/js/events_tradmod.html
然后阅读:
http://www.quirksmode.org/js/events_advanced.html
Can someone explain what is the proper way to make certain actions call functions in javascript? Should I use event handlers like onclick="callFunction();"
? Or should I use an event listener? If yes, how do they work?
解决方案
Read this:
http://www.quirksmode.org/js/events_tradmod.html
Then read this:
http://www.quirksmode.org/js/events_advanced.html
这篇关于事件侦听器vs事件处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文