K
Kalyke
When I try to run my page in safari I get this error msg:
Value undefined (result of expression xmlDoc.load) is not object.
The script works brilliantly in IE and firefox. I'm not sure how to
fix this. I'd appreciate any help here is the code thats causeing the
problem:
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
var x=xmlDoc.getElementsByTagName('picture');
}
catch(e)
{
try //try Firefox, Mozilla, Opera, etc.
{
var xmlDoc = new XMLHttpRequest();
xmlDoc=document.implementation.createDocument("","",null);
} catch(e)
{
alert(e.message);
}
}
//Creates array out of imaes in xml file
xmlDoc.async=false;
xmlDoc.load('pictures.xml');
var x=xmlDoc.getElementsByTagName('picture');
var numXml = x.length;
var setNumbers = numXml / 4;
for (i=0;i<numXml;i++)
{
srcArray = xmlDoc.getElementsByTagName("src")
.firstChild.nodeValue;
altArray = xmlDoc.getElementsByTagName("alt")
.firstChild.nodeValue;
img = "<img src=\'"+srcArray+"\' onClick=\'replaceMain("+i+")\'
onmouseover=\"this.style.cursor=\'pointer\'\" alt=\'"+altArray+"\'
width=144 height=108 >";
imageArray = "<li>"+img+"</li>";
}
}
catch(e){alert(e.message)}
Value undefined (result of expression xmlDoc.load) is not object.
The script works brilliantly in IE and firefox. I'm not sure how to
fix this. I'd appreciate any help here is the code thats causeing the
problem:
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
var x=xmlDoc.getElementsByTagName('picture');
}
catch(e)
{
try //try Firefox, Mozilla, Opera, etc.
{
var xmlDoc = new XMLHttpRequest();
xmlDoc=document.implementation.createDocument("","",null);
} catch(e)
{
alert(e.message);
}
}
//Creates array out of imaes in xml file
xmlDoc.async=false;
xmlDoc.load('pictures.xml');
var x=xmlDoc.getElementsByTagName('picture');
var numXml = x.length;
var setNumbers = numXml / 4;
for (i=0;i<numXml;i++)
{
srcArray = xmlDoc.getElementsByTagName("src")
.firstChild.nodeValue;
altArray = xmlDoc.getElementsByTagName("alt")
.firstChild.nodeValue;
img = "<img src=\'"+srcArray+"\' onClick=\'replaceMain("+i+")\'
onmouseover=\"this.style.cursor=\'pointer\'\" alt=\'"+altArray+"\'
width=144 height=108 >";
imageArray = "<li>"+img+"</li>";
}
}
catch(e){alert(e.message)}