? I was looking for time/date display script that could call the code from a external .js file.
I found this, but can’t get it to work.
I don’t write java but am an experienced web developer and know CSS.
There are already obvious mistakes in the instructions.
Can anybody see any syntax arrors in this script?
Website URL: [url]http://javascriptsource.com/time-date/basic-date-display-2.html
Description: This script will display the month, day, and year, without the day of the week. Clean and simple. The display can be changed with CSS.
Follow the instructions below to use this script on your Web site.
<!– Paste this code into an external JavaScript file named: dateDisplay.js.js –>
/* This script and many more are available free online at
The JavaScript Source :: [url]http://javascript.internet.com
Created by: Lee Underwood :: [url]http://javascript.internet.com/
function displayDate() {
var now = new Date();
var today = now.getDate();
var month = now.getMonth();
var monthName = new Array(12)
monthName[0]=”January “;
monthName[1]=”February “;
monthName[2]=”March “;
monthName[3]=”April “;
monthName[4]=”May “;
monthName[5]=”June “;
monthName[6]=”July “;
monthName[7]=”August “;
monthName[8]=”September “;
monthName[9]=”October “;
monthName[10]=”November “;
monthName[11]=”December “;
var year = now.getFullYear();
document.write(monthName[month]+today+ “, “+year);
}
<!– Paste this code into the BODY section of your HTML document
where you want the date displayed –>
<script type=”text/javascript”>
<!–
displayDate();
//–>
</script>