• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Disable 'Back' and 'Reload' buttons of Browser

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Anybody knows how to disable the 'Back' and 'Reload' buttons.
dbalki
 
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic