I've got a patch for this, mozilla wasn't going down the createelementns path because the value of the namespaceURI is "http://www.w3.org/1999/xhtml" for true xhtml documents (those not served as text/html)... appending the child <script> tag the dom way is of course cool and works fine in xhtml!
I've just posted the modified portion of (the end of) Mochikit.js below... just 3 lines changed, should I create a trac item for this? Eoghan var xhtmlURI = "http://www.w3.org/1999/xhtml"; // new for (i = 0; i < modules.length; i++) { if (MochiKit[modules[i]]) { continue; } var uri = base + modules[i] + '.js'; if (uri in allScripts) { continue; } if (document.documentElement && (document.documentElement.namespaceURI == kXULNSURI || document.documentElement.namespaceURI == xhtmlURI)) { //new // doesn't work in Safari var s = document.createElementNS( document.documentElement.namespaceURI, // changed 'script'); s.setAttribute("id", "MochiKit_" + base + modules[i]); s.setAttribute("src", uri); s.setAttribute("type", "application/x-javascript"); baseElem.parentNode.appendChild(s); } else { var tag = '<' + 'script src="' + uri + '" type="text/javascript"' + '>' + '<' + '/script' + '>'; document.write(tag); } }
