[whatwg] When a script element's child nodes are changed

Bjoern Hoehrmann derhoermi at gmx.net
Fri Oct 28 12:03:00 PDT 2011


* David Flanagan wrote:
>All browsers do that correctly.  The case I'm interested in is this one:
>
>     var s1 = document.createElement("script");
>     var t1 = document.createTextNode("");
>     s1.appendChild(t1);
>     document.head.appendChild(s1);
>     t1.appendData("alert('changed text node data');");
>
>Firefox runs this script and Chrome, Safari and Opera do not. (I don't 
>have a windows installation, so I haven't tested IE)

In "IE9 standards" mode IE9 displays the alert.

>We're not done yet, though.  If I comment out the appendData() call in 
>the code above and replace it with this line:
>
>     s1.appendChild(document.createTextNode("alert('then added a new 
>text node');"));

As above, IE9 displays the alert.
-- 
Björn Höhrmann · mailto:bjoern at hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 


More information about the whatwg mailing list