468,134 Members | 1,278 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,134 developers. It's quick & easy.

Using Javascript to list xml node list in reverse order

57
Hi,
This javascript will display my xml node list:
Expand|Select|Wrap|Line Numbers
  1. x=xmlDoc.getElementsByTagName('title');
  2. for (i=0;i<x.length;i++) {
  3. document.write(x[i].childNodes[0].nodeValue);
  4. document.write("<br />");
  5. }
But I want to display the list in reverse order. I think it would work to put the nodes into an array and then use reverse() to switch it, but I'm not sure exactly how...
Thanks in advance!
Mar 22 '10 #1
1 3420
Dormilich
8,651 Expert Mod 8TB
why so complicated?
Expand|Select|Wrap|Line Numbers
  1. for (i = x.length; i--;)
Mar 22 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by dam_fool_2003 | last post: by
19 posts views Thread by RAJASEKHAR KONDABALA | last post: by
33 posts views Thread by junky_fellow | last post: by
4 posts views Thread by amessimon | last post: by
4 posts views Thread by plmanikandan | last post: by
6 posts views Thread by Joe Estock | last post: by
11 posts views Thread by sam_cit | last post: by
36 posts views Thread by pereges | last post: by
6 posts views Thread by Hamster | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.