473,748 Members | 4,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="JavaS cript">
function printDate(){
var date = new Date();
document.write( date.toLocaleSt ring());
}
</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="JavaS cript">
function printDate(){
var date = new Date();
document.write( date.toLocaleSt ring());
}
</SCRIPT>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#1 11111" width="103%"
id="AutoNumber3 " bgcolor="#00000 0">
..............
</table>

<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#F FFFFF" width="10%"
id="AutoNumber1 " height="67" bgcolor="#00000 0">
<tr>
<td width="1009%" height="516">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#F FFFFF" width="100%"
id="AutoNumber4 " bgcolor="#00000 0" height="523">
<tr>
<td width="100%" bgcolor="#00000 0" 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="JavaS critp">
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 1522

"Jamiil" <ja******@netsc ape.net> wrote in message
news:11******** *************@i 39g2000cwa.goog legroups.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="JavaS cript">
function printDate(){
var date = new Date();
document.write( date.toLocaleSt ring());
}
</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="JavaS cript">
function printDate(){
var date = new Date();
document.write( date.toLocaleSt ring());
}
</SCRIPT>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#1 11111" width="103%"
id="AutoNumber3 " bgcolor="#00000 0">
.............
</table>

<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#F FFFFF" width="10%"
id="AutoNumber1 " height="67" bgcolor="#00000 0">
<tr>
<td width="1009%" height="516">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#F FFFFF" width="100%"
id="AutoNumber4 " bgcolor="#00000 0" height="523">
<tr>
<td width="100%" bgcolor="#00000 0" 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="JavaS critp">
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
1458
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. My problem is that javascript is executed before the mySQL insertion. I actually need the mySQL insertion first, since my javascript function
5
7613
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 the array is needed ratherthan idividual reference. The situation is like this: When the page is loaded based on the user input say 6 values are created like character1="tom", character2="jerry", Character3="micky", Character4="donald",...
5
2441
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 the system. They use IE 6 to communicate with a database and print reports. Everything was working fine up until about 2 or 3 weeks ago. Now when anyone uses the system for a while, JavaScript apparently becomes disabled on the PC they are...
1
6252
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 under lynx and elinks, but some doesn't. Is there any converter from javascript to HTML or PHP or PERL? Is there any ASCII web browser that fully supports Javascript. Thanks
1
352
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 expert in any of these webpage developing laguages. Now, having said that, here is my problem. I got this program from the book JavaScript The definive Guide 3rd Edition, by David Flanagan, published by O'Reilly, <SCRIPT LANGUAGE="JavaScript">...
6
2934
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 HTML is *not* visible in the source view.
0
1548
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? Thanks in Advance :) Prasad
1
1987
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 HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@ taglib uri="/WEB-INF/tag-lib/struts-html-el.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/tag-lib/struts-bean.tld" prefix="bean" %>
8
1516
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
3355
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 once they press login. Any ideas? I've put the code for the form below: <script Language=javascript> <!-- function logonForm_onsubmit() {
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.