"Boris Zbarsky" <bzbarsky@...> wrote in message
> On 9/22/11 4:59 AM, al_9x@... wrote:
>> both the script itself and its load handler log after 'DOMContentLoaded'
> Works correctly over here (script load fires before DOMContentLoaded).
>> Should it be before?
I am running my test in a new profile with the latest nightly as well, on xp
sp3, and it's consistently after:
[14:28:01.433] GET defer.htm [HTTP/1.1 200 OK 0ms]
[14:28:01.586] DOMContentLoaded:[object HTMLDocument] @ defer.htm:3
[14:28:01.641] GET script.js [HTTP/1.1 200 OK 0ms]
[14:28:01.663] external @ script.js:1
[14:28:01.671] load:[object HTMLScriptElement] @ defer.htm:3
What do you make of this? Should I file a bug?
> Because the spec says so?
Where? It doesn't make sense in light of what you've said:
"Some external scripts block the parser because the might issue
but a deferred script can't write to the doc:
[14:20:16.461] A call to document.write() from an asynchronously-loaded
external script was ignored. @ defer.htm
your documentation confirms it:
This Boolean attribute is set to indicate to a browser that the script is
meant to be executed after the document has been parsed. Since this feature
hasn't yet been implemented by all other major browsers, authors should not
assume that the script's execution will actually be deferred. Never call
document.write() from a defer script
so if a deferred script executes after the document has been parsed and
can't write to the doc, why should it block the parser?