W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2012

Re: [whatwg] Deferring javascript download and execution until after onload

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 18 Sep 2012 10:28:42 +0200
Message-ID: <CAAWBYDCmbkx=mvrJsrodRueY1Lf4m352NoOChX1C=zRXqUEJNw@mail.gmail.com>
To: Rick Waldron <waldron.rick@gmail.com>
Cc: WHATWG List <whatwg@whatwg.org>, Andy Davies <dajdavies@gmail.com>, Jonas Sicking <jonas@sicking.cc>
On Tue, Sep 18, 2012 at 10:26 AM, Rick Waldron <waldron.rick@gmail.com> wrote:
> On Tuesday, September 18, 2012 at 2:54 AM, Jonas Sicking wrote:
>> There has been discussions about implementing a "noexec" attribute on
>> <script> which would just load the script but instead of evaluating it
>> as soon as it's available, simply fire the "load" event. There would
>> also be an additional .execute() function on the script which would
>> permit executing the script after it has been loaded.
>
> What happens to the execute() function after the first time it's called? Is it magically removed? Is it nulled? If not, what happens when it's called twice for the same script?

It presumably sets the "has run" flag on the <script>, so the second
call simply does nothing.

~TJ
Received on Tuesday, 18 September 2012 08:29:31 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC