Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to disable Back/Forward navigation buttons?

Status
Not open for further replies.

nabla

Programmer
Aug 15, 2000
11
US
hi

i'm doing a project where i need to disable the Back and Forward buttons in Netscape. i'm already asked the question for IE, and i wonder if there is a way to disable directly the buttons or disable the action associated with those buttons in Netscape.

thanks for your help

nabla [sig][/sig]
 
you cannot disable the back/forward buttons but you can disallow the going back for the user. just put the following script in your page.

<script language=&quot;JavaScript&quot;>
var curPage;
var canNavigate;
canNavigate=0;
curPage=document.location;

function canNav(){
canNavigate=1;
}

function window_onbeforeunload(){
if(canNavigate==0)
window.navigate(curPage);
canNavigate=1;
}
window.onbeforeunload = window_onbeforeunload;
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top