JavaScript City



Mouseover Alert

This script will bring up a JavaScript alert when someone moves the mouse over the link.

Script Code

Grab a copy of the file below and place it in the same directory as the Web page on which you will use the script (if you wish to place the script file in a different directory you will need to make the necessary adjustments to the src attribute of the script tag that calls it).

salert1.js

The code below should be placed between the <body> and </body> tags where you want the link to appear.

Example

A working sample of the script is shown below.

Don't click this link!

Options

The link text can be changed to whatever you like by editing the text between the <a> and </a> tags.

You can change the destination of the link to send the viewer someplace if JavaScript turned off by editing the src attribute of the <a> tag.

You can change the text of the alert by opening the salert1.js file and editing the bold (strong) text on the following line of code:

window.alert("Hey!");

Accessibility

This should be more or less accessible as long as the link has a destination for the viewer to go to if activated with the keybord or with JavaScript turned off (or if the viewer's browswer is too old for the script). If the message is important, the link should go to a page which includes the important information.

It should be noted that this script can be quite irritating and probably should be avoided by professional sites unless absolutely necessary.




eXTReMe Tracker