在vscode中运行js脚本
2020-02-15 本文已影响0人
洛珎
1.新建文件夹Js-text,终端打开,前提是全局已经安装了node
2.下载安装:npm install http-server -g
3.设置端口http-server -p 8001,点击http://127.0.0.1:8001/页面,打开控制台
4.文件夹Js-text下面新建index.html和js文件,并在jindex.html页面引入js文件,这样就可以在js文件中编写js脚本了
![](https://img.haomeiwen.com/i9044981/0034e0526ae1dd8d.png)
![](https://img.haomeiwen.com/i9044981/6c5a36c3b511e481.png)
![](https://img.haomeiwen.com/i9044981/ac32c1f3d097b6a7.png)
![](https://img.haomeiwen.com/i9044981/4409d891e61ae726.png)
1.新建文件夹Js-text,终端打开,前提是全局已经安装了node
2.下载安装:npm install http-server -g
3.设置端口http-server -p 8001,点击http://127.0.0.1:8001/页面,打开控制台
4.文件夹Js-text下面新建index.html和js文件,并在jindex.html页面引入js文件,这样就可以在js文件中编写js脚本了