<!-- TWO STEPS TO INSTALL TIME ON PAGE (UNLOAD): 1. Put the two codes into the HEAD of your HTML document 2. Add the OnLoad event handler to the BODY tag --> <!-- STEP ONE: Copy the two codes into the HEAD of your HTML document --> >HEAD> >SCRIPT LANGUAGE="JavaScript"> <!-- Begin pageOpen = new Date() // End --> >/SCRIPT> >SCRIPT LANGUAGE="Javascript"> <!-- Original: Max Harris (mclh@rocketmail.com) --> <!-- Web Site: http://members.tripod.com/~mclh/index.html --> <!-- This script and many more are available online from --> <!-- The JavaScript Source!! http://javascriptsource.com --> <!-- Begin function openFor() { pageClose = new Date(); minutes = (pageClose.getMinutes() - pageOpen.getMinutes()); seconds = (pageClose.getSeconds() - pageOpen.getSeconds()); time = (seconds + (minutes * 60)); if (time == 1) { return (time + " second") } return (time + " seconds") } // End --> >/SCRIPT> <!-- STEP TWO: Add the OnUnload event handler to the BODY tag --> >BODY OnUnload="alert('It has been ' + openFor() + '. Please stay longer next time!')";> <!-- Script Size: 1.12 KB -->
1998 Copyright (C) Next Step All Rights Reserved