W3C home > Mailing lists > Public > www-html@w3.org > June 2007

Re: XHTML Applications and XML Processors [was Re: xhtml 2.0 noscript]

From: liorean <liorean@gmail.com>
Date: Sat, 2 Jun 2007 09:21:10 +0200
Message-ID: <cee13aa30706020021g7f330f49v8f193353e2d00a3@mail.gmail.com>
To: www-html@w3.org

On 02/06/07, Ian Hickson <ian@hixie.ch> wrote:
> > When I've though about this in the past, I've concluded that the current
> > specifications are inadequate when there are multiple download streams.
> > E.g., if, as ought to be good practice, the scripting library is in a
> > .js file, does anything specify what happens if a function is called
> > before the parallel load of the scripting file completes (and the
> > declaration hasn't yet been seen)?
>
> The specs define this (you get an exception), but it isn't exactly clear
> to me what we can do to make this better in a way that authors would
> actually leverage.


... just brainstorming a little...

How about a new object:
window.loadedScripts {DontEnum, DontDelete , ReadOnly}

All scripts are inserted as properties (using their URL as property
name) in it they have executed. So, one can do:

if ( 'http://example.net/niftylibrary.js' in window.loadedScripts)
    doSomething();


More useful:
window.loadedScripts.addDependentFunction ( EventListener [, URL1 [,
URL2 [, ...]]] )

Executes the listener once all dependencies have been executed, or
immediately if already done.
-- 
David "liorean" Andersson
Received on Saturday, 2 June 2007 07:21:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:10 GMT