Hi Sebastian,Yes, it's an interesting approach: it uses a temporary div node as a sort of "parser" for the HTML source, it then inserts the resulting DOM nodes (the div children created by the assignment to innerHTML ) into the document. But I don't think it's particularly useful in our case: we don't need to parse arbitrary HTML, since we only have to add <script> nodes, so the result is the same as directly inserting script nodes created by createElement(). Perhaps there can be a performance increase since we can avoid the repeated createElement() calls by accumulating all script tags and making a single innerHTML assignment: a quick test with FireFox 2.0 on a P4 3.0Ghz with the at-a-glance demo showed indeed a mean loading time of 276ms when using this technique vs. 362ms when calling createElement() and appendChild() for every script, a performance increase of about 30%; note however that this is only the time it takes for the node creation loop to complete, and does not include the application initialization time, which is much higher. Summing it all up: very slight performance increase against lower standards-compliance; I don't think it's worth using it in our case. Regarding browsers compatibility for the purpose of script inclusion, this technique has similar limitations as direct DOM-nodes creation (only works in FireFox and Opera, and it doesn't work at all in IE), but according to the tests mentioned in the article, it should work in Webkit; however, inserting <script> tags has not been tried: I added a new test (div-children-innerHTML) to my test page (http://www.alessandro.sala.mclink.net/inctest/index.html) and it would be interesting if someone could try it using the latest Webkit. If it works, then this would be a good reason to switch to this technique, since it would allow to increase the supported browsers. Alessandro |
begin:vcard
fn:Alessandro Sala
n:Sala;Alessandro
email;internet:alessandro {dot} sala {at} mclink {dot} net
version:2.1
end:vcard------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
