deadlock Message Board
[ February Full List | Reply ]

Re: a simple way
From Blacktiger on 30 July '01
replying to Websites that disable "back" button posted by Jeff

I've been trying these scripts for disabling the back button but they sometimes work sometimes don't. I've implemented a very easy way to disable the effect of this button.

Create a blank html doc that will act as a intermediate page. Add this code to the body:

<body onload="document.location.href='yourpage.html'"

Now, when you enter the url of that page, it will automatically redirect you to yourpage.html When you push back button, then the intermediate page is called but it will push you forward again to yourpage.html. Since it's a blank page everything is so fast that the user wont notice nothing but a flash.

I know this is of no use for the good purpose of disabling the back button (secure forms etc), but it's perfect for egoist webmasters who don't want their visitors to go back.

I have this in my webpage and it works fine. Moreover I call the intermidiate page with a preloader that loads the images from my page before it loads.




Reply to this message

Required Details
Your name:
Subject:

Optional Details
Home page title:
Home page URL:
Email:
(if you'd like to receive automatic replies by email)

Your Message