• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Javascript in page with frames

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone!
am a fresh new user of this forum. I have a probelm on my page. does anyone know how to disable back button of a browser on a client side? I have a page with frames and don't want user to go back for every single frame, except for the main frame. help me, it si killing me. the personal back button does not count.
ps. a allready have tried no-cache and it does not go to history, but still wasn't good for frames.
thank you in advance
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cant disable the back buuton, however you can prevent the user from going back to that page. what happens is it skips that page and goes to the previous one.
The location object's replace() method overwrites the current history entry with the specified URL. It removes the current history entry before the next URL is loaded. Removing the item from the history list also prevents users from seeing the page again by clicking on the Back button later.
This technique is very useful for online games and multi-page forms, where you want prevent the user from returning to the previous page. Furthermore, the location.replace() method is supported by all browsers except Navigator 2.0x. The following example shows how to use this method in a link:

<A HREF="javascript:location.replace('nextpage.html')">Advance</A>
or this which is part of a java println statement and replaces the frameset with a page.
<input type='button' value ='Go To Checkout' onClick=\"parent.location='http://javaguy.yi.org/examples/LastChance.jsp?name=" + name + "'\">
 
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic