为什么callback 要比 event 消耗更少的内存

event的冒泡机制, 会在冒泡的各个阶段生成不同的event对象, 是通过调用Event类(或是自定义的Event类)的clone方法.

这样做的原因是, 首先event内部需要改currentTarget对象, 如果事件整个阶段只有一个Event对象就不行了.

而且Event对象会被传到用户自定义的侦听器事件处理中, 如果只有一个Event对象, 则无法预知用户将会怎么改动Event对象, 这将对事件后面的传播带来不可预知的影响.

smithfox | Friday 01 April 2011 at 11:33 am | | UI        | Used tags: , ,

two comments

Louis Vuitton iPhone 6 cases

Viewing angles and brightness are more than adequate for your everyday needs, including when you head into a dark room or head out to enjoy some sunshine. Auto brightness settings are fairly accurate, but you may occasionally need to manually adjust for optimal viewing.

Louis Vuitton iPhone 6 cases, (URL) - 20-04-’15 17:20
womens online shops

Magnificent goods from you, man. I’ve consider your
stuff previous to and you’re simply too fantastic.
I actually like what you have obtained here, really like what you are stating and the way during which you assert it.
You are making it entertaining and you continue to care
for to keep it sensible. I cant wait to read far more from you.
That is really a tremendous website.

womens online shops, (URL) - 04-08-’17 05:12
(optional field)
(optional field)
为阻止垃圾广告, 请在提交评论前, 回答一个简单问题(Please answer an simple question)
Remember personal info?
Notify
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.