9
Reply

How to load XML file using in Javascript?

Jitendra Patel

Jitendra Patel

Mar 29 2010 1:59 AM
4k
Hi,

how to load and read xml files using in javascript?
please my javascript function and replay me.

Below my code:-
function loadxml()
{
 var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async = "false";
                    xmlDoc.load("Validation.xml");
                    var Validation = xmlDoc.documentElement;
                    alert(Validation);
                    var Validationtype = Validation.childNodes(0);
                    alert(Validationtype);
                    document.getElementById('Textbox1').innerHTML = Validation.getElementsByTagName("Name")[0].text;
}

Thanks,
Jitendra Patel

Answers (9)