阅读背景:

使用HTML javascript属性“onSOMETHING”或在脚本上为所有元素一次添加事件监听器?

来源:互联网 

Well I use a script that get a external JSON from a file, and loop thru its objects and creates the HTML on a string then after all is done, it appends in the DOM. But I would like to know if it's better to use for example: onclick html attribute (directly into the code) or add an event listener to all html objects by its classes at once with Javascript after appending to the DOM.Well I use a script that get a external JSON fr




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: