nezbo Posted January 24, 2008 Share Posted January 24, 2008 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) Quote Link to comment Share on other sites More sharing options...
nezbo Posted January 24, 2008 Author Share Posted January 24, 2008 i am also geting these errors if any body can help with these? http://validator.w3.org/check?uri=http%3A%2F%2Fwww.eastlancsmedicalservices.co.uk%2F&charset=%28detect+automatically%29&doctype=Inline&ss=1&outline=1&group=0 Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted January 24, 2008 Share Posted January 24, 2008 remove this from your function it will work, document.all only exist in IE if (!document.all) return Quote Link to comment Share on other sites More sharing options...
nezbo Posted January 24, 2008 Author Share Posted January 24, 2008 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 Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted January 25, 2008 Share Posted January 25, 2008 put your <script> content into <head> tag you've put it right on top of the html page... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.