473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

JavaScript & HTML - Help!!

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.

Mar 15 '06 #1
2 1472

"Jamiil" <ja******@netscape.net> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
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.

For one thing - you did not spell JavaScript correctly in the Script tag.
Correct that and it should display the date in white text on black
background.
Even though you're using some deprecated tags and other errors, the date
shows up in a test page I pasted your code into (after closing the missing
table, body, and html tags
Mar 15 '06 #2
Oh man! Thanks so very much, it works!

Mar 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ronan | last post by:
Hi, I have a problem with a form using the PHP PEAR HTML_QuickForm package & javascript: I want to record the content of my form into a mySQL database then execute a javascript function. ...
5
by: Raju V.K | last post by:
I am developing a web site which requires a set og unique values be transferred between pages and server many times. There fore i decided to put the values in an array so that only one reference to...
5
by: BDurst | last post by:
I am experiencing a strange problem with one of my intranet systems and I was wondering if anyone had any suggestions as to what the problem might be. There are several hundred people that use...
1
by: oleg_orel | last post by:
I need to access web sites using my scripts written in Perl. I use lynx and elinks to access web pages. It works fine, unless the pages has some Javascript code. Most Javascript stuff is working...
1
by: Jamiil | last post by:
This is the first time I am ever using JavaScript, I am not even elocuent in HTML, all I am is someone who has Microsoft/Netscape Webpage developers. What I am trying to say is that I am not an...
6
by: dark.peony | last post by:
Hi, (--1--) I'm trying to find a way to jump to a link (<a href="ref"></a>) in a page that is generated with javascript. The source view of the page only shows the javascript methods. The...
0
by: pkhose | last post by:
Hello All, I have one XML file. This file includes Page Heading, Image/SWF files path, Navigation. I have done the menu using JavaScript. Will someone help me out for getting the data from XML? ...
1
by: JumpingOffPlace | last post by:
Hi, I'm hoping that the wealth of knowledge here can stop me from spinning my wheels on this syntax error for hours. :) Below is the code, and the error I am recieving.... Code: <!DOCTYPE...
8
by: TeknoShiv | last post by:
Hiiiiiiiiii any body can suggest me how to validate all pages of any web application at one go as any validator takes a single page at a time wch is the URL of homepage.
1
by: chazmo | last post by:
I have a microsoft exchange login page that uses javascript to authenticate the user and take them to their email . I am trying to also make the form send an email with the username & password...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.