Solved

Disabling the back button in Browser

Posted on 2001-06-26
10
144 Views
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!
robert
0
Comment
Question by:robert
10 Comments
 
LVL 19

Accepted Solution

by:
webwoman earned 100 total points
Comment Utility
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.
0
 

Expert Comment

by:Ironwolf
Comment Utility
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>
     history.forward()
</script>


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,
-IW
0
 
LVL 9

Expert Comment

by:msdixon
Comment Utility
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.
0
 
LVL 19

Expert Comment

by:webwoman
Comment Utility
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?
0
 

Author Comment

by:robert
Comment Utility
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.
cheers
rajesh
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Expert Comment

by:choroque
Comment Utility
0
 

Expert Comment

by:YouLostMyLastRegisteredName
Comment Utility
msdixon,

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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
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.
<note>
   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
</note>

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
It is time to clean this abandoned question up.  

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

<recommendation>
points to webwoman

</recommendation>

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

Cd&
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
Comment from expert accepted a answer

Computer101
E-E Admin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now