Jump to content

function not working in firefox :'(


nezbo

Recommended Posts

Hi all

 

I have been workign on fixing the bugs that i have found on my site and testing it with firefox and i can not get this script to work

 

the function is :

 

function show(){
  if (!document.all)
    return
  var Digital=new Date()
  var weekday=new Array(7)
weekday[0]="Sunday"
weekday[1]="Monday"
weekday[2]="Tuesday"
weekday[3]="Wednesday"
weekday[4]="Thursday"
weekday[5]="Friday"
weekday[6]="Saturday"
  var month=new Array(12)
month[0]="Jan"
month[1]="Feb"
month[2]="Mar"
month[3]="April"
month[4]="May"
month[5]="June"
month[6]="July"
month[7]="Aug"
month[8]="Sep"
month[9]="Oct"
month[10]="Nov"
month[11]="Dec"

  var hours=Digital.getHours()
  var minutes=Digital.getMinutes()
  var seconds=Digital.getSeconds()
  var days=Digital.getDate()
  var day=Digital.getDay()
  var months=Digital.getMonth()
  var years=Digital.getYear()

  if (hours==0)
  {
   	hours=00;
  }
  if (minutes<=9)
  {
   minutes="0"+minutes;
  }
  if (seconds<=9)
  {
   seconds="0"+seconds;
  }
   var ctime=hours+":"+minutes+":"+seconds+" - "+weekday[day]+", "+days+" "+month[months]+" "+years;
   tick.innerHTML=ctime
   
   setTimeout("show()",1000)
}
</script>

 

and to run it :

<span id="tick">No Time</span>
<script type="text/javascript">
window.onload=show;
</script></span>

 

this works fine in IE but i am getting in not loading in firefox.

 

has any one got any idea why it is not working ? (please)

 

 

Link to comment
https://forums.phpfreaks.com/topic/87532-function-not-working-in-firefox/
Share on other sites

super that worked a treat  :)

 

Cheers rajivgonsalves

 

if any one knows how i can fix te rest of the problems on here ? http://validator.w3.org/check?uri=http%3A%2F%2Fwww.eastlancsmedicalservices.co.uk%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.