This is the first time I am ever using JavaScript, I am not even
eloquent in HTML, and all I am is someone who has Microsoft/Netscape
Webpage developers. What I am trying to say is that I am not an expert
in any of these webpage developing languages. Now, having said that,
here is my problem.
I got this program from the book JavaScript "The definitive Guide 3rd
Edition, by David Flanagan, published by O'Reilly,
<SCRIPT LANGUAGE="JavaScript">
function printDate(){
var date = new Date();
document.write(date.toLocaleString());
}
</SCRIPT>
The book shows that this part of the puzzel goes in the <HEAD> and
</HEAD> tags, the implementation of this function is within the <BODY>
and </BODY> tags. However, when implementing the function, I get
nothing, it does not display de date, it does nothing. Here is the
code:
<html>
<head>
....
<title>Jamiil's Home Page</title>
<SCRIPT LANGUAGE="JavaScript">
function printDate(){
var date = new Date();
document.write(date.toLocaleString());
}
</SCRIPT>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="103%"
id="AutoNumber3" bgcolor="#000000">
..............
</table>
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#FFFFFF" width="10%"
id="AutoNumber1" height="67" bgcolor="#000000">
<tr>
<td width="1009%" height="516">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%"
id="AutoNumber4" bgcolor="#000000" height="523">
<tr>
<td width="100%" bgcolor="#000000" height="142">
<img border="0" src="allah.gif" align="left" width="126"
height="141"></td>
</tr>
<tr>
<td width="100%" height="19"><b><font color="#FFFFFF" size="1">
//-----> HERE IS THE CODE IN QUESTION <--------
<SCRIPT LANGUAGE="JavaScritp">
printDate();
</SCRIPT>
</font></b></td>
</tr>
<tr>
..........
Now, can you tell me what am I doing wrong and how to get the current
date to be displayed in the table cell?
TIA.