Make your own free website on

[an error occurred while processing this directive]

Site Menu

Learn all about HTML, how to format text, add images, create tables, meta taga, and more!
Get the low down on JavaScript. See how to create popular JavaScript applications like drop down menus, clocks, dynamic messages, popup boxes, and more.
Concise, easy to follow introdction to CGI and how to install CGI scripts.
Web Design
A miscellanous section that includes various web design tutorials


123 Web Design!

on-the-fly messages

Text inside the document is usually static- if you reload this document 5 times, there's no reason to believe that the document's text will be any different each time...or is there? One of the coolest things about JavaScript is that it allows you to generate text on the fly. You could, for example, have the document greet you "Good morning" in the morning, and "Good night" at night. The basic way to write out text in JavaScript is by using the document.write() command, as follows:

document.write('Some text')

Whatever you put inside the parentheses, JavaScript displays it on the page. Taking this basic idea one step further, I'll create a script that writes out the last modified date of this page.

var modifieddate=document.lastModified

08/07/2001 02:26:24

The above is a perfect example of "on-the-fly" text. The text  reflects the last modified date of your page, and is updated automatically whenever you edit the page and save it!