如何禁用网络浏览器的后退箭头按钮? [英] How to disable back arrow button of web browser?

查看:359
本文介绍了如何禁用网络浏览器的后退箭头按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

当用户单击我网站上的注销按钮时,我想禁用Web浏览器的后退按钮.我该怎么办?

谢谢

Hi!

I want to disable the back button of the web browser when user clicks logout button on my website. How can I do this?

Thanks

推荐答案

它是不可能的.而是正确地编写代码,以使返回的页面重定向到登录页面.关闭安全页面的缓存,以便它们始终重新加载,系统会计算出用户已注销并重定向到登录页面.
IT''s impossible. Instead write your code properly so that going back will redirect to the login page. Turn off caching for your secure pages, so they reload always, and the system works out the user is logged out and redirects to the login page.


尝试以下Java脚本:

try this java script:

function disableBackButton()

window.history.forward()
} 
disableBackButton(); 
window.onload=disableBackButton(); 
window.onpageshow=function(evt) 
{ 
   if(evt.persisted) disableBackButton() 
} 
window.onunload=function() 
{ 
   void(0) 
}



如果对您有帮助,请回复.

谢谢

马赫什·帕特尔
xxx@yahoo.com

RT:删除了您的电子邮件地址.



pls reply if this is help full to you.

Thanks

mahesh patel
xxx@yahoo.com

RT: Removed your email address.


这篇关于如何禁用网络浏览器的后退箭头按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆