|
Note that one part of the script goes in the HEAD of the document
and the other goes in the BODY of the document.
<Html>
<Head>
<title>Putting the date in a web site</title>
<script language=javascript>
<!-- Hide script from old browsers
var dayName = new Array ("Sunday", "Monday",
"Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday")
var monName = new Array ("January",
"February", "March", "April", "May",
"June", "July", "August", "September",
"October", "November", "December")
var now = new Date
// end hiding script from old browsers -->
</script>
<Body bgcolor=white>
<script language=javascript>
<!--hide script from old browsers
document.write ("Today
is " + dayName [now.getDay ()] + ", " + monName [now.getMonth()]
+ " " + now.getDate() + ".")
//end hiding script from old
browsers -->
</script>
</body>
</html>
Click here
to see it in action.
|