View Single Post
Old 09-29-2002, 09:20 PM  
DrewKole
Confirmed User
 
Join Date: Aug 2001
Posts: 5,193
Best way to show current date?

I've got... this javascript below, but I need a way to include that multiple times on the same page... without having to use the script multiple times...

i.e. I have 100 links I want to show the current date that this script does, without having this script 100 times on the page... and bulking up my html

Any way to do that easily?

[script language="Javascript">
!!!!--

// Array of day names
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday");

// Array of month Names
var monthNames = new Array(
"January","February","March","April","May","June", "July",
"August","September","October","November","Decembe r");

!var now = new Date();
document.write(monthNames[now.getMonth()] + " " +
now.getDate());

// --!!!
!/script]

Last edited by DrewKole; 09-29-2002 at 09:29 PM..
DrewKole is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote