[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Disabling the back button in Browser

Posted on 2001-06-26
Medium Priority
Last Modified: 2012-05-04
I would like to diable the back button of the browser!but Window.history.back=flase; does notr seems to be working!
Any idea experts!
Question by:robert
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 19

Accepted Solution

webwoman earned 400 total points
ID: 6227718
You can't disable the back button -- you can't disable ANY buttons on the browser without a signed script, activeX control, or opening a new window without the toolbar/menubar.

You CAN use a replace to simulate it, but why? Unless it's a form that you're trying to keep from having resubmitted, having the back button not work as is expected just makes people annoyed, it doesn't keep them on your site.

And it's easy enough to get around... there are numerous ways.

Expert Comment

ID: 6228659
WebWoman is right, you can't completely disable the back button, there are a lot of goofy things you can do to try to keep them around a page, but users can always get around them.

The easiest little roadblock I use is putting the code:

<script language=JavaScript>

at the top of the page. Every time a user comes to that page, it will push them ahead in the history queue. If they clicked to this page, they will stay there, if they used "back" to get thhere, it will just bump them forward.

It's not pretty and it's not foolproof either, turning off Javascript will get around this.

If you have a captive audience that requires Javascript, this is great, it it's going on the live net, most people should have javascript enabled.

Hope this helps a little,

Expert Comment

ID: 6229298
so why does everyone like to do stupid stuff like this? it's like spawning tons of new windows... not a good way to get repeat visitors.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 19

Expert Comment

ID: 6229945
msdixon, exactly -- all it does is annoy your users and drive them away. If I can't go back to what may be one of YOUR pages, I'll just go somewhere else ENTIRELY -- completely off your site -- and I'll probably never return.

Same thing with disabling right click, opening a new window that won't drop behind or allow me to close it, etc. I will, if necessary, force quit out of an app -- and less experienced users will just SHUT THE THING DOWN -- and I can pretty much GUARANTEE you that if somebody has to go to that type of extreme to get rid of your site, they will never, never EVER go back.

That's as bad as the scripts that force themselves as your home page, and load and won't go away everytime you open the browser. People WILL find a way to get rid of them (if it means they have to reformat and reinstall the entire OS), and they will not, no matter what you do, EVER return to your site.

So you got a few more hits? What did it accomplish, really?

Author Comment

ID: 6230659
Hi guys,
thanks for ur comments.
I understnad ur concern.But eventhough I disable the back button ,still the user can go back through the back button designed on my application.This is the way the application works.If the user uses the back button on the browser , he will be taken to the logon page.This was designed to keep in mind the security of the application.ie this a financial app,
hope u guys got the point.

Expert Comment

ID: 6230898

Expert Comment

ID: 6726800

I would like to do this because I don't want forms to be submitted multiple times, a problem even on this site.  Granted for a public web site this would be annoying but I develop internal applications for my company, so that's not an issue.
LVL 53

Expert Comment

ID: 7811204
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care

LVL 53

Expert Comment

ID: 7910131
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

points to webwoman


If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.


Expert Comment

ID: 7957936
Comment from expert accepted a answer

E-E Admin

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question