W3C home > Mailing lists > Public > public-html-ig-zh@w3.org > October 2010

Re: 讨论一下讨厌的script标签

From: 劭非程 <csf178@gmail.com>
Date: Fri, 22 Oct 2010 21:05:23 +0800
Message-ID: <AANLkTikPajWhdnnKb76GwdMi6KFpeCq6pz=z_jVewWV=@mail.gmail.com>
To: Zi Bin Cheah <zibin@opera.com>
Cc: (wrong string) 樂會ML <public-html-ig-zh@w3.org>
嗯 确实应该写成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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:43:46 UTC