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>
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>
相关文章推荐
- Sharepoint:The security validation for this page is invalid. Click Back in your Web browser
- Disable Back Button in Browser using JavaScript
- Back/Forward and Refresh in browser
- Sharepoint:The security validation for this page is invalid. Click Back in your Web browserSharepoin
- use noscript html tag when user disable the javascript in browser, guide user how to enable the js in different browser and retu
- python + selenium + chrome 在实现back,forward,refresh时的注意事项
- Comet: Low Latency Data for the Browser
- disable the 'org.eclipse.recommenders.completion.rcp' plug-in
- 使用JavaScript的history对象来实现页面前进后退(go/back/forward)。
- Decrypting TLS Browser Traffic With Wireshark – The Easy Way!
- 重读《Programming Pearls》之七:The Back of The Envelope
- How can I disable the User Account Control (UAC) feature on my Windows Vista computer?
- Understanding the difficulty of training deep feedforward neural networks
- Browser, Schmouser(the diverge between JScript and JavaScript)
- 《神经网络:回到未来》(Neural Nets Back to the Future)-ICML 2016
- 轻重缓急 put on the back burner
- [神经网络]2.2/2.3-How the backpropagation algorithm works-The two assumptions we need...(翻译)
- 2.21 Adding Buttons to the User Interface with UIButton
- Using the Apache HTTP Server as a forward proxy to the Internet
- History of the browser user-agent string