I am trying to use JavaScript to load an XML file. Below is the code I am using to load the XML file when it is in the same folder:
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",'dineshkani.xml',false);
xmlhttp.send();
xmlDocument=xmlhttp.responseText;
alert("loaded");
However, I want to be able to load the XML file from a specific location such as 'c:/xml/dineshkani.xml'.
When I try to use the following code
xmlhttp.open("GET",'c:/xml/dineshkani.xml',false);
, the XML file does not load. Is there a different way to load the XML file from this particular location?