Has anyone seen this before? I have a "Now Playing" section for a radio station that displays what song is currently on the air. The on-air computer uploads an xml file with the song title, artist and album name. Then I use a javascript function that loads/displays the xml file and I've been using setInterval or setTimeout to have it update itself.
Here's the xml:
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <audio>
- <title>Song Title</title>
- <artist>Artist</artist>
- <album_title>Album Title</album_title>
- </audio>
Expand|Select|Wrap|Line Numbers
- function nowPlaying() {
- xmlDoc = loadXMLDoc("xml/playlist.xml");
- title = xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue;
- artist = xmlDoc.getElementsByTagName("artist")[0].childNodes[0].nodeValue;
- album_title = xmlDoc.getElementsByTagName("album_title")[0].childNodes[0].nodeValue;
- document.getElementById("nowPlayingText").innerHTML = title + " by " + artist + "<br />From " + album_title;
- setTimeout("nowPlaying()",5000);
- }
Thanks in advance!