Question Locked

JS date code displays date in IE bt not Mozzilla - help!

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi all,

Please help, im stuck!

i have created a simple date ultility using java script, here is the code:

Untitled Document

In addition to this i have inserted this java script into another page:

// JavaScript Document
//set date into variables
var todaysdate = new Date();
year = todaysdate.getFullYear();
month = todaysdate.getMonth();
date = todaysdate.getDate();
day = todaysdate.getDay();

//set the arrays
var monthname = new Array("01","02","03","04","05","06","07","08","09","10","11","12");
var dayname = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); but it doesnt in Mo

The Thing this code generates the date fine, in IE but doesnt in Mozzilla (which is what my wesite is built to use)....anyone know why???

please help

Thankyou

Tom

2 replies

by dancoo

It works fine in Firefox 2.0 for me. I just cut and pasted your code into two files (date.htm and time.js).

I was running them by loading date.htm locally (c:\date.htm) rather than through a web server, but I can't see why that would matter.

This discussion is closed to new replies.