www.webdeveloper.com
Results 1 to 1 of 1

Thread: XML Javascript help! probably easy solution!

  1. #1

    Exclamation XML Javascript help! probably easy solution!

    Hi guys,

    So iv seen this Javascript xml navigator application on w3schools. URL below:

    http://www.w3schools.com/xml/tryit.a...l_app_navigate

    which is almost exactly what im after. I need to do this but display more than one item aty the same time. So it would display the first 6 (or watever number) then cycle through to the next 6. Similar to the php pages style.

    (dont ask me why im doing it with js and not php...i need to)

    If anyone can take a look at the W3schools application and let me know how id amend it that would be great!

    Thanks,

    Mike

    Edit:

    I tried to do it by doing this:

    Code:
    function displayCD()
    {
    artist=(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
    title=(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
    year=(x[i].getElementsByTagName("YEAR")[0].childNodes[0].nodeValue);
    
    artist2=(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
    title2=(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
    year2=(x[i].getElementsByTagName("YEAR")[0].childNodes[0].nodeValue);
    
    txt="Artist: " + artist + "<br />Title: " + title + "<br />Year: "+ year + "<br /><br />Artist: " + artist2 + "<br />Title: " + title2 + "<br />Year: "+ year2;
    document.getElementById("showCD").innerHTML=txt;
    }
    and ofcourse it displayed two items each time...but containing the same data. how do i get the second item to look at the next node?
    Last edited by Dark Light; 06-26-2011 at 01:25 PM.
    Mike Oram
    Elite Web-Creation
    Design Innovation Guaranteed
    www.eliteweb-creation.co.uk

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles