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 MathewsPosted Mar 29, 2010, 11:52 AM
Send below things
Because exact same code working without any roblem here :)
Jitendra PatelPosted Mar 30, 2010, 5:57 AM
Sorry to late replay.
you code is perfectly working.
It's my mistake.
Thanks a lots to solved my problem.
Thanks,
Jitendra Patel
Jitendra PatelPosted Mar 29, 2010, 7:39 AM
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.
Jaish MathewsPosted Mar 29, 2010, 6:53 AM
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 PatelPosted Mar 29, 2010, 5:59 AM
this function is not working.....
onreadystatechange()
than jQuery errors,
xmlDoc.onreadystatechange = verify();
Jitendra PatelPosted Mar 29, 2010, 5:47 AM
Jaish MathewsPosted Mar 29, 2010, 5:23 AM
Jitendra PatelPosted Mar 29, 2010, 5:14 AM
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 MathewsPosted Mar 29, 2010, 2:55 AM
Try this way. I am not sure where the road block is?
XML Used
Code