建構 JS 環境的步驟如下:
🍋 待會所有的檔案,都會放在 project 資料夾中
-
在 project 資料夾中,新增一個檔案叫做「index.html」
-
在 project 資料夾中,新增一個資料夾叫做「js」,在裡面新增一個檔案叫做「all.js」
-
然後,就可以在 index.html 裡面,載入這支 all.js 的檔案了
index.html:
1 2 3 4 5 6 7 8 9
| <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title>
<link rel="stylesheet" href="style.css"> <script src="js/all.js"></script> </head>
|
JS 環境建構完成!