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

Peter Sorotokin wrote:
>> 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?
> 
> Yes. Use URIRequest and eval.

And if I want to execute ECMAScript from Java or vice versa or either of 
those from some other language that has easy access to the DOM but can't 
easily evaluate the script string?  It looked to me like SVG was trying 
to really support Java and ECMAScript on an equal footing; was I wrong?

(Not to mention issues like trying to execute a JavaScript 1.2 script 
from inside JavaScript 1.3 and so forth... eval really does not cut it 
there).

>>   Using a <script> node, I just set the src attribute and insert the 
>> node.
> 
> I think this usage is a hack.

Very well.  Provide an alternate solution to the use cases this solves, 
then?  URIRequest and eval really don't cut it there.

> URIRequest and eval works just as well for that.

It does not, for the reason described above.

> Yes, I saw it; this implies that script element has some sort of a 
> hidden state that has to be managed it some way. I'd rather not 
> introduce it.

Again, feel free to propose other solutions to these common use cases...

-Boris

Received on Wednesday, 1 December 2004 20:40:01 UTC