- From: 劭非程 <csf178@gmail.com>
- Date: Fri, 22 Oct 2010 21:05:23 +0800
- To: Zi Bin Cheah <zibin@opera.com>
- Cc: (wrong string) 樂會ML <public-html-ig-zh@w3.org>
Received on Friday, 22 October 2010 13:06:03 UTC
嗯 确实应该写成addEventListener 其实我主要是想说要有这个事件,这里偷懒了...... 在 2010年10月22日 下午7:32,Zi Bin Cheah <zibin@opera.com>写道: > > > 現在有 DOMContentLoaded 事件 >> > > onEventListener的model比DOM0的onEvent好,不过还是要面对IEhack (attachlistener) > > > >>>> >>>> body.onElementLoad=function(element) { >>>> if(element.id=="content"){ >>>> //do something >>>> } >>>> >>>> > > > 如果我要do many things,就麻烦了 > > body.onEvent = function1(){.....} > body.onEvent = function2(){.....} > body.onEvent = function3(){.....} > > function3会取代function2会取代function1 > > 而eventlistener不会有这个问题 > > addEventlistener(event,function1(), false) > addEventlistener(event,function2(), false) > addEventlistener(event,function3(), false) > > 不过PPK提过以上function1,2,3可能不会依次序实现。 > > > > >
Received on Friday, 22 October 2010 13:06:03 UTC