When I try to open the XML File its show Access Denied javascript error.
This is my XML code:
<?xml version="1.0" encoding="UTF-8" ?>
<company test="test">
<employee id="001" >John</employee>
<turnover>
<year id="2000">100,000</year>
<year id="2001">140,000</year>
<year id="2002">200,000</year>
</turnover>
</company>
This in my JavaScript code.
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","Employee.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
I want to get the values from XML Files.
Any one please tell me how to get value.
you can use it like this http://www.w3schools.com/ajax/ajax_xmlfile.asp