Forum Moderators: open
file1.js:
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>
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.
welcome to Webmasterworld!
Since no-one else has attermpted an answer, I'll give it a go. The javascript functions simply display whatever you send in the setStationInfo() call. Your problem is how do you get hold of the station, artist and song info.
Perhaps this is javascript that the station can put on its own pages to display the current song? In which case they will have a way of inserting the current song into the XXX YYY ZZZ variables.