在线考试时如何完全禁用浏览器的后退按钮? [英] How to completly disable back button of a browser while taking online exam?

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

问题描述

在线考试中,一旦考生点击了开始按钮,我不想让他回到(前一页),如果他使用浏览器属性进行任何活动,他应该在同一页面。一旦他点击提交按钮,他是从该页面出来的。



在这里,如果我清除缓存并按下浏览器后退按钮,页面会显示为文档已过期请求的文档是在Firefox的缓存中不可用。 >如果有人知道让我知道如何实现这个概念......

解决方案

试试这个脚本

 < script> 
window.location.hash =no-back-button;
window.location.hash =Again-No-back-button; //再次因为谷歌浏览器不插入第一个哈希到历史
window.onhashchange = function(){window.location。 hash =no-back-button;}
< / script>

另请参阅 链接 。这 链接 包含demo&下载代码


In online examination once candidate has clicks on start button i dont want to allow him to go back (to previous pages) and he should be in same page if he do any activities by using browser properties.Once he click on the submit button he is coming out of that page.

Here if i clear the cache and press the browser back button the page says as "Document Expired The requested document is not available in Firefox's cache." Therefore i dont want to clear cach insted i need to competly disable back button ie nothing should happen on clicking the back button.

if anybody knows let me know how to achieve this concept......

解决方案

Try this script

<script>
window.location.hash="no-back-button";
window.location.hash="Again-No-back-button";//again because google chrome don't insert first hash into history
window.onhashchange=function(){window.location.hash="no-back-button";}
</script> 

Also refer this link. This link contain demo & Download code

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

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