Solved

Disabling back

Posted on 2000-03-15
5
234 Views
Last Modified: 2012-05-04
Is there a way to disable back functionality (both the button and right click, back)?
0
Comment
Question by:mozack
[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
5 Comments
 
LVL 1

Expert Comment

by:staynegative
ID: 2619692
No there is no way to kill the browser's back button.

You CAN however open a new browser w/ javascript and have it be one w/o the row of navigation buttons.

From there I'd imagine you can disable the right click - again w/ javascript, but you'd have a fun time trying to get it to work on netscape AND IE.  
I tried doing this at one point to try and stop people from stealing images.

Jm
0
 
LVL 8

Expert Comment

by:xabi
ID: 2619693
You can't disable back button.
You can disable right mouse click with this script:

<SCRIPT LANGUAGE="JavaScript1.1">
<!--
var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false

function press(e) {
  if ((ns4 && (e.which == 3 || e.which == 2)) || (ie4 && (event.button == 2 || event.button == 3))) return false
  return true
}
for (var i=0; i<document.images.length; i++) document.images[i].onmousedown=press
for (var i=0; i<document.links.length; i++) document.links[i].onmousedown=press
document.onmousedown=press
if (ns4) window.captureEvents(Event.MOUSEDOWN)
window.onmousedown=press
//-->
</script>
</HEAD>
<BODY  oncontextmenu="return false">

Anyway you can open the document in a new window without toolbar.

xabi
0
 

Expert Comment

by:bdemarzo
ID: 2620093
Combined with the other two items above (disabling right-click and the toolbar buttons using JavaScript), you can also change your links to use window.location.replace() functions, which replace the current entry in the browser's history with the URL you specify in the command.

Example:

<a href="javascript:window.location.replace('someurl.htm')">thelink</a>

0
 

Accepted Solution

by:
Ironwolf earned 200 total points
ID: 2621123
You can place this code:

<script language=JavaScript>
      history.forward()
</script>

at the top of all your pages. history.forward() will push the browser to the next page in the history. So, if it's at every page, no matter how fast or how many times they click the back button, it will kick them all the way back to the page they were on.
Hope this helps,
-IW
0
 

Author Comment

by:mozack
ID: 2633535
Thanks!
history.forward() does what I need...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

632 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