Hice un juego simple de no presionar el botón y hay dos errores (el otro estará en una pregunta diferente) Texto inesperado, este es el código que escribí:
<body> <h1>Don't press the button</h1><br/> <p>DON'T PRESS THE BUTTON</p> <div class="round-button"> <button type="button" onclick="alert('Why Did You Press Me. The next button you click will have consequences')">Don't Click Me</button> </div> <div class="hint-text"> <p><b>VVV V</b></p> </div> <div class="round-button button2"> <button type="button" onclick="alert('Ok, this is your last chance. Don't press anymore buttons... not that there are any')">NOT A BUTTON</button> </div>y este es el codigo de la pagina web:
<body> "Don't Press the Button " <h1>Don't press the button</h1><br/> <p>DON'T PRESS THE BUTTON</p> <div class="round-button"> <button type="button" onclick="alert('Why Did You Press Me. The next button you click will have consequences')">Don't Click Me</button> </div> <div class="hint-text"> <p><b>VVV V</b></p> </div> <div class="round-button button2"> <button type="button" onclick="alert('Ok, this is your last chance. Don't press anymore buttons... not that there are any')">NOT A BUTTON</button> </div> </body>Como dijo @K Scandrett en su comentario, el apóstrofe en "No" está causando su problema. Necesita escapar poniendo un "" antes, así:
onclick="alert('Ok, this is your last chance. Don\'t press anymore buttons... not that there are any')">NOT A BUTTON</button> </div> </body>Los caracteres de escape se utilizan para eliminar el significado especial de un solo carácter y, en su lugar, conservar el valor literal. En este caso, la cita dentro de "No" estaba causando que el programa leyera eso como el final de la cadena e ignorara el resto de esa línea. Es por eso que tienes este error:
{ "mensaje": "Error de sintaxis no detectado: falta) después de la lista de argumentos", }