Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to disable "go back" button

Posted on 2007-12-04
10
Medium Priority
?
620 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
[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
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 21

Accepted Solution

by:
nizsmo earned 600 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
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.

 
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 400 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 600 total points
ID: 20409832
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 400 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…

715 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