1. Configure launch.json
#After configuring this, don’t rush to try it, because at this time click the green After starting the start button debugging, I found that the page could not be opened, but there was a prompt that the browser link failed.
At this time, we need to install server plug-ins such as apache and iis to support the page running and displaying in the simulated server.
2. Install the plug-in [Live Server]
This is the plug-in mentioned above that supports the page running in the simulation server, as shown in the picture:
If the installation is completed and there is a [Reload] prompt on the left, click the button to reload.
3. Open the html page and conduct debugging testing
The basic work is ready. At this time, there are two debugging modes:
Use local static page debugging :
Select the test option you configured, open the page that needs to be debugged, and press F5 to start debugging, as shown in the figure:
Use Debugging in server form:
The live server we installed comes in handy at this time. Also open the page to be debugged, right-click anywhere on the page and select "Open with live server". As shown in the picture:
Complete!
Related learning recommendations: vscode tutorial
The above is the detailed content of How to use debugging with vscode. For more information, please follow other related articles on the PHP Chinese website!