Amogh Amogh - 5 months ago 31
jQuery Question

Restrict user to refresh and back,forward in any browser

I am working on an evaluation system, In which candidate attempt for an exam. So the page where question and its choices are get rendered is an page with

iframe
, In that questions are get render. page which holds
iframe
contains
JavaScript
timer.

So when questions get render on browser to restrict refresh I have written
F5
and
ctrl+F5
blocking code so candidate can't refresh using keyboard shortcuts but in browser window one can still use refresh button or back button. Is there any way to disable this? I know playing with browser functionality is not good practice, So is there any way to get out of this.

Answer

on document.ready I added this line..

window.history.forward(-1)

Comments