...

View Full Version : need help with javascript.



Prashank
07-21-2011, 05: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:

DanInMa
07-21-2011, 07: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;
</script>

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

look into setTimeout if you dare.

Prashank
07-23-2011, 01:06 PM
THANK YOU
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