Where to Put Your Scripts
Using External Scripts
Putting Comments in Scripts
Alerting the User
Confirming a User's Choice
Prompting the User
Redirecting the User with a Link
Using JavaScript to Enhance Links
Working with Referrer Pages
To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.
See it run: Using JavaScript to Enhance Links
The HTML page for the link-enhancement example.
This JavaScript allows you to perform an action after the user clicks a link, but before the browser goes to the link's destination.