您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

怎么在vscode中调试js代码

2024/8/28 8:44:58发布38次查看
在左侧扩展中搜索debugger for chrome并点击安装
在自己的html工程目录下面点击f5,或者在左侧选择调试按钮
选择下拉按钮,会有一个添加,选择chrome
之后会出现laungh.json的配置文件在自己的项目目录下面
不过对于不同的代码文件要调试的话,每次都需要修改一下配置文件
{ "version": "0.2.0", "configurations": [{ "type": "chrome", "request": "launch", "name": "launch chrome against localhost", "url": "http://localhost:8080", "webroot": "${workspaceroot}" }, { "type": "chrome", "request": "attach", "name": "attach to chrome", "port": 9222, "webroot": "${workspaceroot}" }, { "name": "launch index.html (disable sourcemaps)", "type": "chrome", "request": "launch", "sourcemaps": false, "file": "${workspaceroot}/jstest/test1/test1.html" #每次需要修改这里的文件地址 } ]}
到这里就可以进行调试了,在
中选择 launch index.html (disable sourcemaps) 调试项,按f5调试,会出现,同时打开goole浏览器,点击
即可进入调试阶段。
相关文章教程推荐:vscode教程
以上就是怎么在vscode中调试js代码的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product