ok I've narrowed down what the problem is...
I'm loading an xml and xsl file with javascript in my page, then writing the transformation output to the page:
Code:
function loadXML(url){
var xml = new ActiveXObject("Microsoft.XMLDOM");
var xsl = new ActiveXObject("Microsoft.XMLDOM");
xsl.async = false;
xsl.load('the_xsl_file.xsl');
xml.onreadystatechange = function () {
if (xml.readyState == 4) document.write(xml.transformNode(xsl));
};
xml.load(url);
}
I'm calling that function within the <body>, after having also loaded an external .js file in the <head>. Part of the html that the transformation outputs are script tags that depend on what's in the external file.
Here's the problem: when I open the file locally everything works fine, the output fills the <body> with what I want, and the functions defined in the external script file get called. But when I put it up on the web (one of my company's development servers) the xml/xsl output looks like it's completely overwriting everything else in the page, including where I load the other javascript file, so it can't find it when I try and call its functions.
So then my question is why is it overwriting everything else in my page and how can I stop it from doing this?