The JavaScript Goodies Book
Alert Scripts
These button, link, and e-mail scripts all produce alert, prompt, or confirm boxes.
- No Clicking!
Disables user's ability to click on page (requires MSIE 4.0).
- Alert Page Verification Form
Posts new page when part of form has not been filled out or has not been filled out correctly.
- How Long Load?
How long did it take your page to load? This script will tell you.
- Screen Rez
Have the right screen settings for this page? Use this script to alert your users.
- 800 x 600 Alert
Pops up alert box if user has settings at 800 x 600, but you can change it to whatever settings you want.
- Web-TV User Alert
Pops up alert box when WebTV user stops by.
- Update Alert
When someone enters page, this pops up alert with date and time of page's last update.
- No Go IE
Tells user that they are not using Internet Explorer and that the following page has some IE-only elements. A choice to enter is then offered.
- Multiple Alerts
That's what you get when you click.
- Three Choices
Gives alert box that offers three choices to viewer before going into site.
- Coming From?
Produces alert that welcomes user from page they just left.
- Are You 18?
If yes, you go in -- if no, too bad.
- Chooser Script
Gives list of pages to choose from. Choose one and tell browser what to do with it.
- Yes, No Script
Do you go in? Yes or no.
- Thank You Link
Gets your name then sends you to link of your choice with alert message.
- Personalized Welcome
As is, this script asks for your domain, then gives nice greeting. Change it to ask for anything, then give same greeting.
- Pop-Up Box
When someone logs in to page, alert box pops up. They see page no matter what button they choose.
- A Better Pop-Up Box
Works the same way as the one above, but it won't allow the viewer in the page if they choose "Cancel."
- Insert Name
Pops up prompt box asking for viewer's name. What they enter is posted throughout the page.
- Coming and Going
Posts alert when person enters and again when they leave.
- Anonymous Name
Asks for name, same as above. However, this script enables viewer to remain anonymous if they so choose.
- Mouse-Over Alert Box
Produces alert box when mouse passes over link.
- Advanced Mouse-Over Alert Box
Puts up prompt box asking for person's name. After writing it in, alert box pops up saying "Hi."
- Click For Alert Box
Clicking on link brings up alert box.
- First/Last Name
Pops up prompt box that asks for viewer's first and last names, then posts it where you want it in document.
- Answer to Page
Pops up prompt box and asks question. Depending on answer, viewer is sent to specific page. The names are a bit out of date but you can fix that.
- A Confirm Box
Works pretty much like previous ones, except it's a confirm box. Has question mark rather than exclamation point.
[Back to the JavaScript Goodies Page]