禁用后退按钮在浏览器中使用jQuery? [英] Disable Back Button in Browser using jquery?
问题描述
我想禁用后退按钮时注销用户点击这个,我删除该用户不能在会话我的应用程序只有饼干。并要禁用后退按钮
如果(的getCookie(用户名)==){
禁用后退按钮; //我们用window.history.redirect为JavaScript我期待的jQuery这个}
请帮我..
code:
< HTML>
&所述; HEAD>
<脚本类型=文/ JavaScript的>
window.history.forward();
功能noBack(){
window.history.forward();
}
< / SCRIPT>
< / HEAD>
&所述; BODY onload事件=noBack(); onpageshow =如果(event.persisted)noBack(); onunload的=>
< / BODY>
< / HTML>
I would like to Disable Back button when user click on logoff for this i delete only cookies of that user not session in my application. And want to disable Back button
if(getCookie('username') == ""){
Disable back button;// we use "window.history.redirect" for javascript i look jquery for this
}
Please help me..
This is another technique to disable the back functionality in any webpage. We can disable the back navigation by adding following code in the webpage. Now the catch here is that you have to add this code in all the pages where you want to avoid user to get back from previous page. For example user follows the navigation page1 -> page2. And you want to stop user from page2 to go back to page1. In this case all following code in page1.
CODE:
<HTML>
<HEAD>
<SCRIPT type="text/javascript">
window.history.forward();
function noBack() {
window.history.forward();
}
</SCRIPT>
</HEAD>
<BODY onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
</BODY>
</HTML>
这篇关于禁用后退按钮在浏览器中使用jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!