window.history.forward () does not work in Firefox

0

I have the function: window.history.forward ();

function dontback(){ 
   window.history.forward();
}        
   
<body onload="dontback();">
<form blablabla >

I use it so that the user can not go back, in Chrome and Internet Explorer it works, preventing the user from going back, but in Firefox it does not work. What should I do?

Edit: the version of Firefox that I use is 56.0

    
asked by EduBw 16.10.2017 в 09:14
source

1 answer

1

Only change the way you check the Load

function dontback(){ 
   window.history.forward();
}    
window.onload = dontback;// En Lugar del HTML
    
answered by 16.10.2017 в 09:44