- From: Bjoern Hoehrmann <derhoermi@gmx.net>
- Date: Fri, 28 Oct 2011 23:46:22 +0200
* David Flanagan wrote: >What is the correct behavior for the following code? > ><script> >window.onload = test; > >function test() { > var s = document.createElement("script"); > document.head.appendChild(s); > > var f = document.createDocumentFragment(); > >f.appendChild(document.createTextNode("alert(document.scripts[1].text);")); > f.appendChild(document.createTextNode("alert(2);")); > f.appendChild(document.createTextNode("alert(3);")); > > s.appendChild(f); > > alert(s.text); >} ></script> > >In Firefox, the code in all three text nodes runs, so there are 4 alerts >in total, and the first and the fourth display the same text: the >concatenation of the three text nodes. IE9 Standards mode is the same. -- 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/
Received on Friday, 28 October 2011 14:46:22 UTC