Home / Free JavaScripts / Clocks, Calenders, And Timers / Here

Cut & Paste  Time limit on viewing document script (Required NS 3.x, 4.x, or IE 4.x)

Credit: JavaScript Kit

Description: A script that sets a time limit on how long a surfer can spend viewing the document. The time left will be constantly shown at the status bar below. After time has expired (ie: 1 minute and 30 seconds), the browser will automatically navigate to another page, forcing the surfer out.

Example: Look at your status bar after the document has loaded to see how much time remains before you get ejected!


Step 1: Insert the below in the <head> section of your page. Change var limit from 1:30 (1 min and 30 secs) to your own limit. If you want the limit to be less than 1 min (ie, 30 seconds), enter 0:30. Be sure to also change the target URL to be forced to from to your own.

Step 2: Add the below to the <body> tag itself, like this:

<body onLoad="begintimer()">

JavaScript Tools:
Site Info

CopyRight (c) 2015 JavaScript Kit. NO PART may be reproduced without author's permission. Contact Info