statements can recognize and respond to user events such as mouse clicks, popup
windows, page navigation, last page update info and MUCH more!
Essentially, events are messages generated by browsers indicating that a visitor to your page
enter valid information into a form. Without any network transmission, an HTML page with
if the input is invalid.
from some source, process that data, and output the results. Because it is integrated into
programming. You don't need a fancy computer, you don't need any software other than a
word processor and a Web browser, and you don't need access to a Web server; you can do
all your work right on your own computer.
essentially a mechanism by which developers can embed a higher level of functionality, not
just functional information, into an HTML page.
However, there are times when you may want enhance your page with something more
than what HTML alone can offer, WITHOUT the complexity of JAVA.
higher) or Microsoft Internet Explorer (version 3.0 or higher). Since these two browsers are
Example: Creating a ‘pop-up’ window
a small message window will appear on the screen on demand.
1. Open Dreamweaver by selecting START > PROGRAMS > MACROMEDIA DREAMWEAVER.
3. In the Property inspector
, type in the following command in the link field of the property
Now, hit enter.
*Important: Don’t forget to include both the colon and the semicolon, by doing this you are
4. With the text still selected (or highlighted), open the Behaviors panel
You can do this several ways:
Pressing Shift + F3 at the same time opens the behaviors panel
Select from the menu bar, WINDOW > BEHAVIORS
Click on the ‘cog wheel icon’ at lower right corner of screen
5. You will now choose 2 actions from the ‘actions’ pop-up menu by clicking on the
This ‘plus’ command is a pop-up menu of actions (or events) that can be attached to the
currently selected element. Do the following 3 steps:
Select ‘show events for’
and then choose ‘4.0 and later browsers’
Click on the
Select from the menu: popup message. When the message box appears, type the
“When this popup window appears on your screen, it will make you smile.”
6. Now click on the ‘okay’ button.
8. Click once on your text and your pop-up window should appear – congratulations!
but if you are just beginning, stick with the title and head tags.
write ( ) or writeln ( ). The difference between write and writeln is: write just outputs a text and writeln
outputs a line feed (horizontal rule) after the text output.
Example: Displaying automatic page update information
Let's say you have a homepage
and you update it frequently. Wouldn't it be nice to include the last update date on your page? Well, here is how you can do
1. Open a new browser (Netscape or Internet Explorer)
2. Open notepad, go to START >PROGRAMS >ACCESSORIES >NOTEPAD
In the notepad screen, type the following HTML code exactly as it appears:
<TITLE>Displaying Update Info</TITLE>
<!--hide script from old browsers
document.write("<h2>This page has been updated: " +
document.lastModified + "</h2>");
// end hiding -->
4. Save file as sample.html onto the DESKTOP
5. Go to your browser window menu, click on
FILE>OPEN PAGE >BROWSE >SELECT>sample.html
This site contains a lot of examples (and a great tutorial) along with source code to get you started in
functionality to enhance your Web site.
April 17, 2001
Library Instruction – University of Texas as Austin
Dr. Loriene Roy