I have a HTML page on which I am trying to access a remote XML file. However, it gives me an error in Firefox (xmlDoc has no properties)
Here is the code I use;
In the html page;
xmlDoc=loadXMLDoc(“
In the called js;
function loadXMLDoc(dname)
{
if (window.ActiveXObject)
var xmlDoc = new ActiveXObject(“Microsoft.XMLDOM”);
else if (document.implementation && document.implementation.createDocument)
var xmlDoc= document.implementation.createDocument(“”,”doc”,nu ll);
try
{
xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);
}
catch(e) {alert(“error”)}
return(null);
}
Now here is my question. If I use a local/same domain file (e.g. abc.xml), it works fine both in IE and FF..
But it gives an error if I try to access the remote XML file [url]http://mysite.com/abc.xml
I know this might have to do something with permission/security, but I can directly access the remote XML file by typing from my browser and also I have set the permssion of the remote XML to lowest 777 (meaning read/write/execute)
If it is not possible to load, can I at least import and then use the XML on my page..
Basically, I need to use a common XML file across various pages/sites.
Please help.
Thank you.