W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2011

[whatwg] Proposal for separating script downloads and execution

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 3 Feb 2011 17:15:43 -0800
Message-ID: <AANLkTik_=edTrHGO80zAwicvxvob8jg8k8AQe8eu9Vac@mail.gmail.com>
On Thu, Feb 3, 2011 at 4:53 PM, Nicholas Zakas <nzakas at yahoo-inc.com> wrote:
> I don't think readyState as Kyle describes is an appropriate candidate mechanism because it's not an actual indicator that the functionality exists. The only thing you can really be sure of if readyState is "uninitialized" is that the script element supports readyState. The fact the only browser supporting this presently is the same one that supports the desired behavior is a happy coincidence. There's nothing about the presence of readyState in general or the particular value that gives any explicit indication that adding the script node will result in a particular download/execute behavior. You may as well test another well-known IE property like (typeof ActiveXObject == "object").
> The thing I like about my proposal (with of course, the obvious bias that it is my proposal), is that it's easy and unconfusing to determine if the browser supports delayed execution by testing for the presence of script.execute.
> Even if my solution isn't the best one, I do believe the best one needs to follow this model of explicit feature detection.

I agree. I don't think that the readyState mechanism is particularly
simpler. Another nice thing about the noexecute design is that it is
purely opt-in, which means that you don't risk poor on already
existing pages.

/ Jonas
Received on Thursday, 3 February 2011 17:15:43 UTC

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