Hi,

I have used successfully this way of loading remote scripts (before I used
to use XmlHttpRequest for AJAX purposes):

function loadScript(url, id) {
        var scriptTag = document.getElementById(id);
        var head = document.getElementsByTagName('head').item(0)
        if (scriptTag) {
                head.removeChild(scriptTag);
        }
        script = document.createElement('script');
        script.src = url;
        script.type = 'text/javascript';
        script.id = id;
        head.appendChild(script)
}

Hope this helps.


Alessandro Sala wrote:
> 
> thank you all for your suggestions,  I made several test and 
> unfortunately it doesn't work; here
> are the results:
> 
> - Appending <script> tags to  <head> (where the  inclusion of 
> script/custom.js is usually placed) does not
> work neither in IE6, nor in FF nor in Opera: the <script> tags get 
> added, the script sources get requested
> from the web server but it seems they are not parsed.
> 
> - Inserting a <div> tag into <head> and adding <script> tags inside it 
> does work in FF but neither in Opera  nor
> in IE6, as above. As a side note, even if this worked in all browsers, 
> it wouldn't produce a valid XHTML
> document, since its DTD only allows script, style, meta, link, object, 
> base and title elements inside head elements.
> 
> - I moved the inclusion of script/custom.js to <body> and appended 
> <script>s to <body> or to <head> with or
> without enclosing them in divs but the results were always the same as 
> above.
> 
> It seems that adding script tags while the document is being loaded is a 
> tough problem for all browsers: all in all
> the DOM appendChild() + XHTMLRequest workaround for IE6 problems seems 
> the most standards-compliant
> and practical solution at the moment even if it's not the most efficient.
> 
> Any other ideas?
> 

-- 
View this message in context: 
http://www.nabble.com/Re%3A-Qooxdoo-and-XHTML-documents-tf2506117.html#a7025020
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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

Reply via email to