-
-
Save parzibyte/d7dea0c8ffb55ace7f43bbae72e65439 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Prevenir que usuario deje la página - By Parzibyte</title> | |
</head> | |
<body> | |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias placeat laborum, magni fugiat ab, rerum iure | |
ducimus, asperiores sequi dolores ex quos labore exercitationem vitae modi autem repudiandae pariatur earum!</p> | |
<script> | |
window.addEventListener("beforeunload", (evento) => { | |
if (true) { | |
evento.preventDefault(); | |
evento.returnValue = ""; | |
return ""; | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment