Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
Error de sintaxis no detectado: final inesperado de la entrada para <script> </script>

Estoy usando el siguiente JavaScript/html para reproducir un video en Chrome.

La consola registra "Error de sintaxis no detectado: final inesperado de la entrada".

No veo lo que estoy haciendo mal. ¿Cuál es mi error aquí?

¡Gracias!

 <html> <head><meta name="viewport"> <style> video { position: relative; } </style> </head> <body> <video ontouchstart="playPause()" controls="controls" poster="" video width="100%" height="auto" autoplay id="vid"> <source id="somefileID" src="file:///d:/dev/videos/Das%20Krokodil-Lied.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> </video> <script> function playPause(e) { if (!document.getElementById("myVideo")) { alert("Element does not exist. Let's create it."); } var myVideo = document.getElementById("vid"); if (myVideo = null) { alert('video is null!'); } else { if (myVideo.paused) { myVideo.play(); } else { myVideo.pause(); } } </script> </body> </html>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tienes algunos problemas:

  1. Te perdiste la llave final de tu código. El uso de una buena estructura de tabulación lo ayudaría a ver más fácilmente dónde faltaba el aparato ortopédico.
  2. Usaste asignación = en lugar de ==

Busque **** a continuación:

 function playPause(e) { if (!document.getElementById("myVideo")) { alert("Element does not exist. Let's create it."); } var myVideo = document.getElementById("vid"); if (myVideo == null) // **** You probably mean == **** { alert('video is null!'); } else { if (myVideo.paused) { myVideo.play(); } else { myVideo.pause(); } } } // **** MISSING ****
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!