how to restrict page leave in javascript

Solutions on MaxInterview for how to restrict page leave in javascript by the best coders in the world

showing results for - "how to restrict page leave in javascript"
Alina
03 Jan 2017
1window.onbeforeunload = function(){
2   // Do something
3}
4
Ilaria
09 Jan 2021
1window.addEventListener("beforeunload", function(e){
2   // Do something
3}, false);
4
similar questions
queries leading to this page
how to restrict page leave in javascript