Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display console.log output in Visual Studio Code for html?

When I used brackets, there was a plugin to display console.log output in a panel below the source code panel, so I don't need switch to chrome and press F12 to view console.log output.

But how to do that in Visual Studio Code?

I use Visual Studio Code for HTML development not Node.js.

like image 348
lionyu Avatar asked Feb 08 '17 06:02

lionyu


2 Answers

debugger-for-chrome can solve the problem. Check this link. It shows how to do that

--UPDATE--

Now VS code has built in debugging support for Javascript.

enter image description here

You can easily debug your application by clicking on the Run and Debug button as shown in the image. If you want to debug any other languages or runtimes, you need to install a debugger extension for that specified language or runtime in the VS code marketplace.

https://code.visualstudio.com/Docs/editor/debugging

like image 96
Amila Dulanjana Avatar answered Oct 29 '22 11:10

Amila Dulanjana


You could create an index.html and link to your .js in head then use Live Server with an "undock separate window."

like image 43
Lewger1637 Avatar answered Oct 29 '22 09:10

Lewger1637