Click here to Skip to main content
15,849,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Team,
I want to read xml using XMLHttpRequest. below code works fine firefox but not working in Chrome.

xmlhttp = new XMLHttpRequest();
xmlhttp.open(xmlpath, false);
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.send();
xmlDoc = xmlhttp.responseXML;

i don't know, what to do. if any one know about the share me the answer.


Regards
Nanda Kishore.CH
Posted
Comments
Solai Raja 3-Mar-15 1:18am    
check with developer tool's console for JavaScript errors. Press f12 then refresh your page.

Consult the documentation for "open", the first param is the method (get, post etc) and then the url and asynch

xmlhttp.open("GET", xmlpath, false);
 
Share this answer
 
You could try using jQuery, that will take away any browser inconsistenties.
Although it should work. So maybe go for Solai Raja's advice.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900