Okay, I've finally got access to my XML with this, which works great in FF and IE, but not in Safari:
Code:
function loadXMLDoc(dname)
{
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
var oMSIE = true;
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc=document.implementation.createDocument("","",null);
var oMSIE = false;
}
catch(e) {alert(e.message)}
}
try
{
xmlDoc.async=false;
xmlDoc.load(dname);
if (oMSIE == false){
alert(xmlDoc.childNodes[0].nodeName);
} else if (oMSIE == true){
alert(xmlDoc.childNodes[1].nodeName);
}
return(xmlDoc);
}
catch(e) {alert(e.message)}
return(null);
}
var oXML = loadXMLDoc("http://autofusion.com/development/mm3/example_results/example_feed.xml"); // alerts "results" in FF and IE, "Value undefined (result of expression xmlDoc.load) is not object" in Safari.
If anyone knows how to get this function working in Safari, it would be greatly appreciated!
Bookmarks