Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

Disabling the back button in Browser

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
robert
Asked:
robert
1 Solution
 
webwomanCommented:
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
 
IronwolfCommented:
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
 
msdixonCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
webwomanCommented:
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
 
robertAuthor Commented:
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
 
choroqueCommented:
0
 
YouLostMyLastRegisteredNameCommented:
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
 
COBOLdinosaurCommented:
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
 
COBOLdinosaurCommented:
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
 
Computer101Commented:
Comment from expert accepted a answer

Computer101
E-E Admin
0

Featured Post

Independent Software Vendors: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now