View Full Version : need help with javascript.

07-21-2011, 04:16 PM
I want a script that go back in history after 3 sec on loading a page.

<a href="javascript:history.go(-1)">Go back</a>
This script let you go back in history but i want that its automatically execute after 3 sec.

Please help.:confused:

07-21-2011, 06:04 PM
try adding this to the <head> section

<script type="text/javascript">
function go_back() {
var t=setTimeout("history.go(-1)",3000)

window.onload = go_back;

rnd me
07-21-2011, 06:59 PM
that sounds in-accessible and really annoying...

look into setTimeout if you dare.

07-23-2011, 12:06 PM
You have solved my problem. I need it for automatically closing the lightbox.

many many many thanks for this.:thumbsup:

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum