您的位置:首页 > Web前端 > JavaScript

disable the browser's Forward/Back buttons(msdn)

2005-10-27 16:10 239 查看
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/dnwebteam/html/webteam07032000.htm#back
There is no way to clear the session history through script, as you have found. Our mantra for most session-history questions like this is location.replace. Because you control all of the pages on your site, you can use location.replace to navigate from one page to another. This will replace the current history entry with the new page, so you always have only one entry from your site on the stack. Here's a snippet that shows how you can change your links to get this behavior.<A HREF="next.html" onclick="javascript:location.replace(this.href); event.returnValue=false; event.cancelBubble=true;">
Click here to navigate to the next page without adding the current page to the history stack.
</A>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  browser javascript session