Share this Page URL

Chapter 17. The Programmable Page: Addin... > Some JavaScript Examples - Pg. 196

The Programmable Page: Adding JavaScripts to Your Pages <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- document.write("This page was last edited on " + document.lastModified) //--> </SCRIPT> 196 Figure 17.2 shows how things shake out in Netscape. Figure 17.2. Use document.write() to add text to your page on the fly. The text shown in the previous example is a bit plain. Can you put some fancy pants on it? No problem. You can easily add HTML tags within the document.write() statement. Here's a revised script (see jswrite2.htm on the CD in this book) that does just that: <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- document.write("<FONT FACE='Arial' SIZE=+1><B>This page was last edited on <TT>" + document.lastModified) + "</TT></B></FONT>" //-->