pivectcrypeme
New Member
It works for Firefox but not for Chrome and IE.I try it on local.I get error on httpObj.send( null ); line.How can i handle this problem ?HTML File\[code\]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>XML READ</title> <script type="text/javascript">//--- function GetXml() { if (window.XMLHttpRequest) { var httpObj = new XMLHttpRequest(); } else { var httpObj = new ActiveXObject("Microsoft.XMLHTTP"); } httpObj.open("GET", "notification.xml", false); // Error Starts Here httpObj.send( null ); var xmlDocument = httpObj.responseXML; var xmlEl = xmlDocument.getElementsByTagName("haber"); //-- for (i = 0; i < xmlEl.length; i++) { for (j = 0; j < xmlEl.childNodes.length; j++) { if (xmlEl.childNodes[j].nodeType != 1) { continue; } alert(xmlEl.childNodes[j].firstChild.nodeValue); } } } </script></head><body onload="GetXml()"></body></html>\[/code\]XML File\[code\] <?xml version="1.0" encoding="utf-8" ?> <notifications> <notification id="001"> <name>First</name> </notification> <notification id="002"> <name>Second</name> </notification> </notifications>\[/code\]