How to completly disable back button of a browser while taking online exam?

前端 未结 6 888
醉话见心
醉话见心 2020-12-15 11:46

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

6条回答
  •  孤城傲影
    2020-12-15 12:38

    you can not actually override the default behaviour of browsers back button, it is a security concern among browsers.

    however you can code in some sense that make your back appear disable. Check one of my responses I gave some time back. how to stop browser back button using javascript. It is still working fine for me (Bad luck for IE-7). But what if some one has disable javascript in browser. This will fail this logic completely which could be a rare case.

    another practice you can follow is to open your page link inside window.open(). But it has its own advantages and disadvantages. See Here

提交回复
热议问题