[whatwg] Deferring javascript download and execution until after onload

Tab Atkins Jr. jackalmage at gmail.com
Tue Sep 18 01:28:42 PDT 2012


On Tue, Sep 18, 2012 at 10:26 AM, Rick Waldron <waldron.rick at 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



More information about the whatwg mailing list