SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Parse a XML element with AJAX
-
Jul 18, 2007, 09:44 #1
Parse a XML element with AJAX
I need to parse a element from a XML file:
<a>
<b>45</b>
<c>67</c>
</a>
<a>
<b>98</b>
<c>89</c>
</a>
So I try to read and put in a html element the first value of b with the next code:
Code:document.getElementById("apDiv3").innerHTML=xmlDoc.getElementsByTagName("b")[0].data; or document.getElementById("apDiv3").innerHTML=xmlDoc.getElementsByTagName("b")[0].value;
-
Jul 19, 2007, 05:56 #2
- Join Date
- May 2003
- Location
- Cambridge, UK
- Posts
- 2,366
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try getElementsByTagName('b')[0].childNodes[0].value instead.
Bookmarks