W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2007

[whatwg] setting .src of a SCRIPT element

From: Křištof Želechovski <giecrilj@stegny.2a.pl>
Date: Thu, 31 May 2007 12:20:07 +0200
Message-ID: <001001c7a36d$4398f950$1a01080a@POCZTOWIEC>
The script in question is already as bad as it can be: it needs time 10 *
(5?+ content length) and 20 context switches to run.  I would not mind
making it even worse by reexecuting the script each time.  There is a chance
the script developer would learn how to write better code (that is, a DOM
property value should be built incrementally, if so desired, on the script
side) if he noticed that effect.
Cheers
Chris
-----Original Message-----
From: whatwg-bounces@lists.whatwg.org
[mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Jonas Sicking
Sent: Thursday, May 31, 2007 3:27 AM
To: Hallvord R M Steen; whatwg
Subject: Re: [whatwg] setting .src of a SCRIPT element

Another thing that would be weird would be inline scripts. How would the 
following behave:
s = document.createElement('script');
document.head.appendChild(s);
for (i = 0; i < 10; i++) {
   s.textContent += "a" + i + " += 5;";
}
Would you reexecute the entire script every time data was appended to 
the script? Would you try to just execute the new parts? Would you do 
nothing? IE gets around this problem by not supporting dynamically 
created inline scripts at all, which I think is a really bad solution.
Received on Thursday, 31 May 2007 03:20:07 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:55 UTC