C
ChrisW
I'm fairly new to Ajax - I understand the principles of XML, can do
the PHP side, but am getting a bit lost with the JavaScript.
I've seen a couple of different ways of using JS to manipulate the
XML: 1 way using the getElementsByTagName method (as advocated by
W3Schools - http://www.w3schools.com/Dom/dom_nodes_get.asp) and a
seemingly different method (http://scriptasylum.com/tutorials/
xml_javascript/xml_javascript.html) - is either way recommended more
or less (or any other way I haven't found yet)?
I also haven't found any kind of decent API - is there one about? For
example, I want to be able to get the value of an attribute from one
of my nodes - I tried
xmlDoc.getElementsByTagName("info")
[0].childNodes[0].getAttribute("type");
but it doesn't work (in either IE or Firefox), but I can't find any
other way to do it. Cross-browser compatibility is also a big concern
for me, so if anyone can point me in the direction of a decent
tutorial, I'd be most grateful!
Thanks,
Chris
the PHP side, but am getting a bit lost with the JavaScript.
I've seen a couple of different ways of using JS to manipulate the
XML: 1 way using the getElementsByTagName method (as advocated by
W3Schools - http://www.w3schools.com/Dom/dom_nodes_get.asp) and a
seemingly different method (http://scriptasylum.com/tutorials/
xml_javascript/xml_javascript.html) - is either way recommended more
or less (or any other way I haven't found yet)?
I also haven't found any kind of decent API - is there one about? For
example, I want to be able to get the value of an attribute from one
of my nodes - I tried
xmlDoc.getElementsByTagName("info")
[0].childNodes[0].getAttribute("type");
but it doesn't work (in either IE or Firefox), but I can't find any
other way to do it. Cross-browser compatibility is also a big concern
for me, so if anyone can point me in the direction of a decent
tutorial, I'd be most grateful!
Thanks,
Chris