Keep Alerts active in js

0

How can I retain alerts in js?

Normally the browser asks you:

Quieres volver a ver este tipo de mensajes?

Example:

<html>

<head>
  <title>Ejemplo</title>
  <script>
    function mensaje() {
      alert('Este es el mensaje que me refiero. El que esta debajo de este mensaje');
    }
  </script>
</head>
<body onload="mensaje();">
  Ejemplo
</body>
</html>

Well they can be omitted or simply closed.

My goal is to keep the alerts until the correct answer is met with no option to close or cancel the alert.

    
asked by matteo 21.04.2017 в 17:13
source

1 answer

1

Well, you can not, because it is a type of security that has browsers against the familiar pages that fill you with alerts so that you stay on the site and do not go back.

The question is why do you want to do this?

What are you developing?

Because you can do differently the questions as a div that does not stop bothering until you answer correctly. But not to keep you on a page, because that depends on the browser.

I hope I have been clear and focused on what you want to do. Greetings!

    
answered by 21.04.2017 в 17:18