![](/img/trans.png)
[英]why is thenextweb team page including an external php file with <script> tag
[英]Including external javascript file in html page via src tag
我正在通過遵循與此相關的laracasts系列網絡廣播來嘗試vuejs。 我使用netbeans 8.1作為編輯器,您可以在上面看到我的文件結構。 在https://laracasts.com/series/learning-vuejs/episodes/5中, Jeffery Way顯示了我已改編的以下代碼:
<head>
<title>Tasks</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.12/vue.js"></script>
<script type="text/javascript" src="Sources/app.js"></script>
</head>
在控制台中,我看到:
GET http://localhost:8383/vue1/Sources/app.js net::ERR_EMPTY_RESPONSE
我懷疑我的文件路徑錯誤。 我一直在閱讀http://www.jibbering.com/faq/faq_notes/script_tags.html,但沒有找到答案。 我究竟做錯了什么?
“站點根目錄”是否與“源文件”位於同一文件夾中?
如果是,請嘗試:
<script type="text/javascript" src="../Sources/app.js"></script>
或將“源目錄”移到“網站根目錄”內部。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.