| Author |
Back Button disabling using javascript
|
Ajay Vikas
Ranch Hand
Joined: Nov 08, 2006
Posts: 66
|
|
Can anybody please advice me how to disable back button of a window using java script? Thanks in advance!!! Regards, Ajay.
|
 |
stef li
Greenhorn
Joined: Jan 16, 2006
Posts: 27
|
|
there are two approaches to involve it. 1. window.open(url); window.opener.close(); 2. window.location.replace(url); example: <a href="#" on*click="window.location.replace('http://www.stefli.com/');">stefli</a>
|
This guy is so lazy!!!<br />There is nothing left!
|
 |
Ajay Vikas
Ranch Hand
Joined: Nov 08, 2006
Posts: 66
|
|
Hi stef , Thank you for your quick reply it is working. -- Regards, Ajay
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Option 1 is really bad and browser security should prevent it Option 2 will fail with users with JS disabled. A better option for #2 Eric
|
 |
 |
|
|
subject: Back Button disabling using javascript
|
|
|