2016-05-18 95 views
0

文件起初,我對我的英語:))包括JS的HTML

我遇到了一些問題,當我嘗試包括index.html文件的.js

<script src "../src/man/js/Generator.js"> </script> 

但當遺憾我按F12進行調試,出現如下錯誤: 「未能加載」../src/man/js/Generator.js'from source/src/man/js/Generator.js「 這是文件結構:

那我該如何處理呢?

+1

你錯過了'我在'/ src/man/js'中。 – Scott

+1

哦,對不起,我只寫錯了這篇文章的鏈接,但在我的項目中,我寫的是正確的「../src/main/js/Generator.js」。 我想使用「resourceroot」,但我不知道如何使用它? –

+1

你可以發佈一個完整的錯誤信息,它提供了所有的細節嗎? – Scott

回答

0

哦,你必須檢查你的路徑。 <script src "../src/man/js/Generator.js"> </script> 將不起作用。 但是, <script src "../src/main/js/Generator.js"> </script> 將工作。 哥們,你忘了 '我' 在 '主'

1

你缺少=

<script src="../src/main/js/Generator.js"></script> 
0

請加等於SRC = 「路徑」

<script src="../src/man/js/Generator.js"> </script>