Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
How to use VS Code to debug JavaScript within HTML?

How do I set up Visual Studio Code to debug with breakpoints a JavaScript file which is part of an HTML file?

What I want to accomplish is demonstrated in this video, but it doesn't explain how to set it up:

https://www.youtube.com/watch?v=2ub2GCC8DHg&t=190s

Edit:

What the video shows: The video shows a JavaScript program (and the HTML file it's attached to) running in Microsoft Edge browser. The JavaScript is being debugged in VS Code with breakpoints. The browser pauses when a break point is reached. Then the browser resumes when the JavaScript resumes running after the break point.

What I've tried: I've installed VS Code and I'm able to debug standalone (not part of an HTML file) JavaScript with break points. When it comes to running JavaScript that's part of an HTML file, I can run the files in a web browser by pasting into it the file path of the HTML file. I'm also able to run the files with an extension called Live Preview by Microsoft. The JavaScript and HTML files run fine together without errors in my browser.

Where I'm stuck: There is no sync between the browser and VS Code. When I try to debug the JavaScript, it doesn't know it's part of the HTML. It is debugged as standalone, so there's an error because it needs the DOM object from the HTML file.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda