W3C home > Mailing lists > Public > www-svg@w3.org > December 2004

Re: LC Comment - Script & Progressive Rendering / Multiple Pages

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 01 Dec 2004 11:57:30 -0600
Message-ID: <41AE060A.8000309@mit.edu>
To: Peter Sorotokin <psorotok@adobe.com>
CC: www-svg@w3.org

Peter Sorotokin wrote:
> I don't think HTML or XHTML spec really defines it.

You're correct, it does not.  There's a de-facto standard, not a de-jure one.

> If new script needs to be executed at runtime, just execute script 
> through your language-dependent mechanisms explicitly.

I want to dynamically execute the script at http://foo at runtime.  Using 
language-dependent mechanisms in ECMAScript I have to somehow load the data into 
a string (dealing with character encodings in the process) and then call eval() 
on it?  Using a <script> node, I just set the src attribute and insert the node.

This is a relatively common use case on the web, especially for working around 
UA bugs by executing slightly different scripts based on UA-sniffing or 
object-sniffing (though most pages use document.write() instead of creating 
nodes via DOM, the concept is the same and document.write() is not available in 
SVG).

> If script is executed on insertion, a lot of funny issues arise. For instance, if I 
> remove a branch from a tree and then insert it somewhere else all the 
> scripts in that branch will be reexecuted

Not necessarily.  See the algorithm described in my last response to Jim.

-Boris
Received on Wednesday, 1 December 2004 17:57:40 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:29 GMT