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

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