Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

253
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda