Solved

how to disable "go back" button

Posted on 2007-12-04
10
599 Views
Last Modified: 2012-05-05
Hi,

I quick question - how to disable Go Back on the page (either clicking on the browser's button or via the context menu)?

Thank you,

A
0
Comment
Question by:andy7789
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 21

Accepted Solution

by:
nizsmo earned 150 total points
ID: 20409652
Three methods described here:
http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911

But it is not possible to disable the right click>>back function, and the methods are never going to be completely foolproof.
0
 

Author Comment

by:andy7789
ID: 20409671
but right click can be disabled by placing

<body onLoad="oncontextmenu="return false">

works fine - ested 1000 times
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20409679
hmm, i guess you can do that with the combination of one of the methods above, which would catch 95% of the users.

Why i say 95%, because 95% of the users have javascript enabled, for the 5% of the users, these methods will not work at all as javascript will not even get a chance to run.

Hope this helps :)
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 25

Expert Comment

by:imitchie
ID: 20409705
Firefox + Noscript is very very common..... and Firefox is up to 25% usage now (statistics always lie, if you don't like this one, I can show you another!)
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20409731
indeed, noscript was what i had in mind (as i use it myself). Still though, majority of the users do have javascript enabled, so for most of the users it would work, but certainly not all.
0
 

Author Comment

by:andy7789
ID: 20409751
that code is not exactly what i am looking for. I am opening a modal window with ajax and, while all clicks on the page except the modal window are disabled, the back button makes a big mess. Jscript is absolutely fine as the whole site is not functional without jscript.

What I need is to make sure that clicking on the back button would stay on the same page

Any other solutions
0
 
LVL 25

Assisted Solution

by:imitchie
imitchie earned 100 total points
ID: 20409786
The only way so far is still
  history.go(+1)
A lot of sites you that and is very annoying. A smart(er) user will dropdown the history and go back 2 steps, but your 80% joe average will not do that. nor will they use right-click...
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 150 total points
ID: 20409832
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 100 total points
ID: 20410004
0
 

Author Comment

by:andy7789
ID: 20410191
thank you guys, I guess my question goes to a different angle: how to disable page caching for certain pages, because it is the main reason for a mess when clicking the back button. I am posting another question and splitting the points for this one.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

777 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