Information Technology Reference
In-Depth Information
File with
PostScript
formatting
instructions
Page in
PostScript
format
Program for
PostScript
processing
Window on
computer
screen
File
fowarding
Page
displayed
Browser
program
Figure 13.2
Processing a page utilizing PostScript formatting instructions.
formatting instructions with programs that respond specifically to
something you do on a Web page or to other events related to your
browser. For example, one program or script may be run when you
type material into a text box, and another program may be run
when you click “Submit.” Such programs can be linked to most any
activity, such as typing, pressing a mouse button, or releasing the
mouse button. In addition, a program can be run when the page
first loads into your browser, and a final program can be run when
your browser completes its work on your page and goes onto an
other page. Technically, each such activity you perform on a Web
page is called an event , and HTML allows a Web programmer to
associate a script or program with a wide range of events. This type
of programming is called event-driven programming .
As an example, consider a Web page that helps you prepare to
ship a package. On the Web page's form, you will need to supply
your own address, the address the package is going to, the type of
shipping (postal mail, United Parcel Service, Federal Express), and
the speed of delivery (overnight, second day, regular delivery, bulk
rate). In return, the Web site will let you know how much your
package will cost, and your shipping office will be able to print a
special shipping label for you when you deliver your package. As an
example, Figure 13.3 shows such a form, used by the Grinnell
College mail service.
Now, let's consider possible supplements to this form. First, we
might want a table of cities and ZIP codes to appear in a separate
window. Second, as a user fills out the form, we might want to
check that the address is reasonable. (Names should contain mostly
letters with only limited punctuation and digits, states should have
twoletter abbreviations, ZIP codes should have either five digits or
nine digits with a dash between the fifth and sixth digits.) Thus, we
might associate a script to each field in the form, which would check
the field as it is completed. Third, when the user clicks “Submit,”
Search WWH ::




Custom Search