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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.