0

Can anybody tell me meaning of below code.

<script language="Javascript" type="text/javascript">

    function preventBack() { window.history.forward(); }
    setTimeout("preventBack()", 0);
    window.onunload = function () { null };

</script> 
Jui Test
  • 2,399
  • 14
  • 49
  • 76
  • 1
    setTimeout("preventBack()", 0);means call preventBack() function on delay of 0 second.I have one doubt,does function get call everytime.Means continous... – Jui Test Apr 04 '16 at 11:58
  • see this page for more information: http://stackoverflow.com/questions/961188/disable-browsers-back-button – Dr. Aaron Dishno Apr 04 '16 at 12:53
  • The forward() method loads the next URL in the history list. setTimeout(func|code, delay) means its delay of 0 seconds http://javascript.info/tutorial/settimeout-setinterval – Prabhat Sinha Apr 05 '16 at 10:37

0 Answers0