Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 05-02-2005, 10:47 PM   #1
Baseband Member
Join Date: Mar 2004
Posts: 26
Default browser concern

Hi All!

I am making a site using dreamweaver. I used javascript for the date of my website. When I tested my website using IE, everything is ok but, when I used Mozilla Firefox, the date appears on the upper left corner, outside the table I made. Here is the code:



<!-- Begin

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thu rsday','Friday','Saturday');

// Array list of months.
var months = new Array('January','February','March','April','May',' June','July','August','September','October','Novem ber','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;

// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

// End -->

<div align="center">
<table width="740" border="0" cellpadding="0" cellspacing="0">


So, how do i fix it to make it work for the Mozilla Firefox browser?


Cjpixel is offline   Reply With Quote
Old 05-03-2005, 07:59 AM   #2
Fully Optimized
technoman's Avatar
Join Date: Dec 2004
Posts: 3,382
Default Re: browser concern

put the code in a table

~~~ tEcHnOmAn ~~~
technoman is offline   Reply With Quote
Old 05-11-2005, 02:37 PM   #3
Site Team
root's Avatar
Join Date: Mar 2004
Posts: 8,047
Default Re: browser concern

There are two problems as far as I can see...

The first is the code sample you have posted is so incomplete that you can't tell where you are actually calling the functions for the clock...

Since your code is so incomplete that it can't actually be debugged, I'll post some new code for you...

var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year<2000)
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
var cdate="<small><font color='000000' face='Arial' size=1><b> &nbsp"+montharray[month]+" "+daym+", "+year + "</b></font></small>"
if (document.all)
if (!document.all)
function goforit(){
if (document.all)

 <body onLoad="goforit()"> 
	<table border="2" vALIGN="left">
	<span id="clock"></span>
root is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 11:22 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0