onoprise
12-06-2008, 10:41 PM
i am currently using the code below from w3schools to parse a xml file and it works fine in firefox and ie, but when i try to view the site from safari, i get an error
here is the error from safari:
Value undefined (result of expression xmlDoc.load) is not object.
i am using the following code (originally from w3schools (http://www.w3schools.com/Dom/tryit.asp?filename=try_dom_parser)):
function loadXMLDoc(dname)
{
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc=document.implementation.createDocument("","",null);
}
catch(e) {alert(e.message)}
}
try
{
xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);
}
catch(e) {alert(e.message)}
return(null);
}
i tried following the xmlhttpreq example from apple (http://developer.apple.com/internet/webcontent/xmlhttpreq.html), but i couldnt get to work.
if anyone has any advise, i'm all ears. thanks in advance.
here is the error from safari:
Value undefined (result of expression xmlDoc.load) is not object.
i am using the following code (originally from w3schools (http://www.w3schools.com/Dom/tryit.asp?filename=try_dom_parser)):
function loadXMLDoc(dname)
{
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc=document.implementation.createDocument("","",null);
}
catch(e) {alert(e.message)}
}
try
{
xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);
}
catch(e) {alert(e.message)}
return(null);
}
i tried following the xmlhttpreq example from apple (http://developer.apple.com/internet/webcontent/xmlhttpreq.html), but i couldnt get to work.
if anyone has any advise, i'm all ears. thanks in advance.