Prerequisites: Familiarity with basic HTML.
a. Create a Web directory for this lab.
b. Open a browser window onto that directory.
We're going to start by looking at exercises that use alert boxes. While alert boxes are annoying and rarely used in good Web pages (except for error reporting), they are a nice way of providing quick feedback on whether or not your program is running correctly.
Create a Web page with two buttons, one that brings up one alert, another that brings up another alert.
Create a Web page with a field and a button and that brings up an alert whose text contains the text of the field.
Create a Web page that brings up an alert whose text depends on the
query string of the page. (E.g., if the page is
you should do something with the value of
name (which is
Okay, now you've had fun looking dialog boxes. Let's start to explore some more serious changes to the page.
Create a Web page with two parts. In the top section, place some stylized text (e.g., surrounded by a border). In the bottom section, place a simple form with a field and a button. When the user clicks the button, the text in the field should replace the text in the top section.
Extend your solution from the previous page so that it restores the text in the top section after ten seconds.
Create a Web page with two parts. In the top section, place an extended set of preformatted text. In the bottom section, place a simple form with a field and a button.
The user should enter the name of a file on the local filesystem. When the user clicks the button, if the file exists, the body of that file should be placed in the preformatted text section. If the file does not exist, you should bring up an alert.
Create a new version of the previous page in which the user must supply the URL of a Web page, rather than the path to a local file. (You should do your best to present the fetched value as plain text.)
Make a list of the security holes we've opened not just in our own applications, but also on our server, by writing those last two program.
Wednesday, 3 November 2010 [Samuel A. Rebelsky]
I usually create these pages
on the fly, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Mon Nov 29 09:06:18 2010.
The source to the document was last modified on Wed Nov 3 10:52:12 2010.
This document may be found at
A PDF version of this document may be found at
You may wish to validate this document's HTML ; ;Samuel A. Rebelsky, firstname.lastname@example.org