Scripts | JS tutorials | Applets | Web Tutorials | Forum | Freewarejava

spacer.gif (810 bytes)


Click here!

Home / Free JavaScripts / Other / Here

Website Abstraction

Cut & Paste "Please bookmark my site" alert!

Credit: Website Abstraction

Description: This is a script that reminds your surfers to bookmark your site whenever he/she leaves the page. To avoid over-irritating your surfers, the message appears only the first time the surfer enters and leaves the page; if he/she goes to CNN for a while, then returns and leaves again, the message is not displayed. (Try leaving this page the first time- a message will be displayed. Come back, then leave again- no message!).

Note: This script uses cookies to keep track of the number of times the user has entered/left the page, thus, the browser the surfer is using must to cookie enabled to see any message at all.

Example:

Directions

Step 1: Add the below to the <head> section of your page:

Step 2: Add the below onunload event handler to the <body> tag, as follows:

<body onunload="bookmarkme()">

Subscribe to our new newsletter, FREE!
Get weekly updates on Website Abstraction AND Freewarejava.com, for FREE! Subscribe to this popular web developer newsletter, and stay informed on the latest development in both JavaScript and Java.

Dynamic Drive DHTML code library
spacer.gif (810 bytes)

CopyRight © 1997-1999 Website Abstraction. All rights reserved

Click here for free Java applets!
spacer.gif (810 bytes)