?
Solved

Disabling the back button in Browser

Posted on 2001-06-26
10
Medium Priority
?
153 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
[X]
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
10 Comments
 
LVL 19

Accepted Solution

by:
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.
0
 

Expert Comment

by:Ironwolf
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>
     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
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.
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 19

Expert Comment

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

Author Comment

by:robert
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.
cheers
rajesh
0
 
LVL 1

Expert Comment

by:choroque
ID: 6230898
0
 

Expert Comment

by:YouLostMyLastRegisteredName
ID: 6726800
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
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.
<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
ID: 7910131
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
ID: 7957936
Comment from expert accepted a answer

Computer101
E-E Admin
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
Suggested Courses

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