Member Avatar for djMot
djMot

I'm looking to replace an auto-updating iFrame with some cooler, and more accurate ajax code. And first off I'll say that I believe ajax is the right way to approach this, but I'm open to suggestions, too. I'm not really much of a javascript/ajax programmer, hence I'm hoping for a little guidance here. Being an MCSD, I do understand and can read code and pseudo-code.

The website where this is needed is an internet radio station. The auto-updating iFrame shows what song is currently playing. It's best if you just see it, so please feel free to visit Girls Rock Radio and notice the "Now Playing" section of each page at the site on the right side of the page, below the title graphic and nav bar.

The iFrame displays a page that auto-refreshes every 90 seconds. That works out pretty well, and it seems to update frequently enough to make it seem that it's keeping pretty constant track with the actual song change, even though it's really not.

Behind the scenes, the radio station automation software is updating a file on the web server precisely when the song changes. I can control what information goes into that file, like artist, song title, album, year, genre, filespec to the album art, etc... Pretty much anything that's in the database about that song. What I may NOT be able to enter into that file is something outside of the database - the time the song just started playing, for instance - which would be valuable to know in this situation. But I do have the date/time the file was updated from the servers file system, so I'm no worse for the wear, I guess.

Song length is in the database, so some math based on file date/time and song length should be able to produce the next update file read.

Can anyone help me with some ideas on how to handle an auto-updating ajax replacement for the existing auto-updating iFrame?

Thanks!