aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Javascript in page with frames Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Javascript in page with frames" Watch "Javascript in page with frames" New topic
Author

Javascript in page with frames

rok mag
Greenhorn

Joined: Jul 13, 2001
Posts: 2
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
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4093
    
    1
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 + "'\">

SCJP
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Javascript in page with frames
 
Similar Threads
deleting left frame from inside the right frame using javascript
Frames not working properly in Netscape 6.2
Resizing frame when positioning the mouse in the frame
NETSCAPE 6.2 & FRAMES
submit button is not working