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
Loading

Jaish MathewsRank #225 · 11K reputationPosted Mar 29, 2010, 7:52 AM EDT
Send below things
Because exact same code working without any roblem here :)
Jaish MathewsRank #225 · 11K reputationPosted Mar 28, 2010, 10:55 PM EDT
Try this way. I am not sure where the road block is?
XML Used
Code
Jitendra Patel138 reputationPosted Mar 29, 2010, 1:14 AM EDT
when I use above code than
in Loadxml function
var xmlDocElement = xmlDoc.documentElement;
xmlDocElement is null.
it's value is not get........
Thanks,
Jitenra Patel
Jaish MathewsRank #225 · 11K reputationPosted Mar 29, 2010, 1:23 AM EDT
Jitendra Patel138 reputationPosted Mar 29, 2010, 1:47 AM EDT
Jitendra Patel138 reputationPosted Mar 29, 2010, 1:59 AM EDT
this function is not working.....
onreadystatechange()
than jQuery errors,
xmlDoc.onreadystatechange = verify();
Jaish MathewsRank #225 · 11K reputationPosted Mar 29, 2010, 2:53 AM EDT
xmlDoc.onreadystatechange = verify();
is wrong
xmlDoc.onreadystatechange = verify;
We are assigning the Ref. not value. I got xmlDocElement too with your XML. Let me know the updates.
Jitendra Patel138 reputationPosted Mar 29, 2010, 3:39 AM EDT
I have used both but it is not working
xmlDoc.onreadystatechange = verify;
and
xmlDoc.onreadystatechange = verify();
after complete this line then print this
alert(xmlDoc.onreadystatechange);
than errors.
Still it is not working.
Jitendra Patel138 reputationPosted Mar 30, 2010, 1:57 AM EDT
Sorry to late replay.
you code is perfectly working.
It's my mistake.
Thanks a lots to solved my problem.
Thanks,
Jitendra Patel