• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable 'Back' and 'Reload' buttons of Browser

 
Balki Dhar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Anybody knows how to disable the 'Back' and 'Reload' buttons.
dbalki
 
Angela Poynton
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't do it I'm afraid! You cannot change browser functionality! It's a real pain, but I've never found a way round it!
 
bill bozeman
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Angela is right. Can't do it. Best bet is to use a popup window and hide the menubar,toolbar,etc... But someone can still right click on your page and reload it, or hit CTRL-R or F4 in the browsers.
Sorry about that.
 
Balki Dhar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Angela and Bill
Thank you very much. I will try to popup a window without toolbar for my application.
dbalki
 
henrie
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using this code to disable the right mouse button:
<script language="JavaScript">
var SealoffSource = true; /* to disable the right mouse button, so the source can not been seen. */
function click() {if (event.button==2) {alert('The source is sealed off..')}}
document.onmousedown=click;
</script>
H.
 
Mindy Walker
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your page is displaying in a pop-up/daughter window, you can hide the button bar.
Here is some excellent code that works very well in both Netscape and IE:
Place this code within your HEAD tags:
<script language="JavaScript">
<!-- Begin pop-up window code
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'width=600,height=338,menubar=no,toolbar=no,location=no,scrollbars=no,status=no,resizable=yes,');");
}
// End pop-up window code -->
</script>
The "menubar=no,toolbar=no,location=no,scrollbars=no,status=no,resizable=yes" defines which features you would like the browser to use.
This is the link code calling JavaScript:
<a href="javascript :popUp(your_filename.html')">Click here so you can't use your back button!</a>
Have a splendiferous day!
Mindy
[This message has been edited by Mindy Walker (edited October 25, 2000).]
 
praveenpr
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not possible to fiddle the toolbar buttons......however the back button can be indirectly disable by not allowing the history to go more than 1.
 
Reda Mokrane
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
To make the back button hard ... try this snnipet
<SCRIPT LANGUAGE="JavaScript">
javascript:window.history.forward(1);
</SCRIPT>

Originally posted by praveenpr:
It is not possible to fiddle the toolbar buttons......however the back button can be indirectly disable by not allowing the history to go more than 1.

 
Toshit Bhardwaj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well..you can't actually disable back button but you can prevent it going back ..by using javascripts history.forward function..
Okay so ..when you logged off from page 1 and wants to goto page 3...take page 2 as middle page ...instead of going to page 3 directly ..go via page 2...
your page 2 will redirect to page3 and will be having javascript history.forward function..
here is the code
you need to put in page2
<script language="javascript">
window.location="page3.html"
window.history.forward(2);
</script>

and that's the solution for your problem...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic