-
Need to get this "now playing" script work
Hi everyone,
i really need help with this script. Let me tell you that I'm not that good with javascripts.
This is a script that is suppose to give information from an internet radio (station name, song title, song artist ...) and update the song info when the next song starts playing.
Here is the script:
file1.js:
Code:
function getObj(name)
{
if (document.all)
{
return document.all[name];
} else {
return document.getElementById(name);
}
}
function changeInnerHTML(theId,theHTML){
try{
oobj = getObj(theId);
//alert(theId+"---"+theHTML);
oobj.innerHTML=theHTML;
}catch(e){
}
}
// this part is on another file: file2.asp <script src="/file1.js"></script>
Code:
function setStationInfo(stationText,artistText,songText)
{
//alert(stationText+"--"+artistText+"--"+songText+"--"+albumText+"--"+buyUrl)
if(stationText!="")
{
x = getObj("station");
x.innerHTML=stationText;
}
if(artistText!=" [0:0]")
{
x = getObj("artist");
x.innerHTML=artistText;
}
if(songText!="")
{
x = getObj("song");
x.innerHTML=songText;
} </script>
//calling the function (this is where i'm LOST
<script xmlns:ui="urn:ui">
parent.setRefresh(21);
setStationInfo("XXX","YYY", "ZZZ");</script>
Question:
when I run the script, the station info does not change when sthe song change, All that is displayed is the "XXX", "YYY, and "ZZZ" and I understand why (this is obvious). What I want to know is WHAT do I put in place of the "XXX" "YYY" "ZZZ" so that I get the proper song info when a new song starts. I hope my question is clear.
Thank you SO much for your help.
PS: you can see it in action here:
http://radio.planetatv.com/radio/sta...Oldies/70s/90s
just click on one of the radio stations on the left of the screen
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks