I am trying to create a site that lists radio programs that are “on the air” based on the visitors computer. I’m using this right now, which works fine for weekday programs.
<SCRIPT LANGUAGE=”JAVASCRIPT”>
today = new Date()
if ((today.getHours() >14) && (today.getHours() <=18)){
document.write (“<IMG HEIGHT = 18 WIDTH = 75 SRC = ‘air.gif’>”)
}
</SCRIPT>
I’m also using this method:
<script language=”javascript” type=”text/javascript”>
<!– Begin
document.write(“”)
day = new Date()
hr = day.getHours()
document.write(“”)
if (hr == 1)
document.write(“1AM”)
if (hr == 2)
etc…etc…
document.write(“”)
// End –>
Same problem.
How can I incorporate the day into the equation?
I tried this, but it’s BOGUS!!!
<script language=”javascript” type=”text/javascript”>
<!– Begin
function DayOfWeek() {
var now = new Array(‘sunday’,’monday’,’tuesday’,’wednesday’,’thursday’,’friday’,’saturday’);
day = new Date()
var dow = now.getDay()
var hr = day.getHours()
document.write(“”)
if (hr == 17) && (dow == monday)
document.write(“MONDAY’S MESSAGE AT 5PM”)
document.write(“”)
// End –>
I just want a script that will display who is live, on the air, for multiple radio stations, for any given time of the week and hour of the day.
Here is the page I am working on, so you can see the examples:
[url]http://mouthtick.com/test.php
Any help would be appreciated, Thanks!