Cannot read XML file using javascript other than Firefox

reyboy28

New Member
I am using the following code to read an external xml file :\[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","myxmlfile.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; \[/code\]But the above code seems to work only on Firefox and not on Chrome/IE/Opera.In Chrome I am getting an error in Console as cross domain access not allowed, but my xml file, js file and html file are all in the same folder in my local hard drive.Any help on this?Thanks.
 
Back
Top