首先安装插件
debuger for chrome
deguger for firefox
live server
php debug
open in default browse
php live server
然后选中要调试的文件所在的文件夹,如果是html文件,而需要调试js文件。而js文件在html文件夹的子文件中,则只需要打开
html文件所在的文件夹。点击配置debug
选中chrome
然后配置文件launch.json如下
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"file": "${file}" ///我这里可以加上 "skipFiles":["jquery.*.js"],
}
]
}
也可以加上上面///后面需要删除的内容。
在js文件中设置断点。
打开html文件,按f5运行即可。