【发布时间】:2014-02-27 23:23:16
【问题描述】:
我有一个 HTML 页面,我正在尝试包含一些 js 文件,例如
<script type="text/javascript" src="../bower_components/jquery/jquery.js"></script>
但我不断得到
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8080/bower_components/jquery/jquery.js".
紧随其后
Uncaught SyntaxError: Unexpected token < jquery.js:1
在开发者控制台中。我正在尝试一些关于 angular.js 和 node.js 的教程
【问题讨论】:
-
当您将浏览器指向
http://localhost:8080/bower_components/jquery/jquery.js时会发生什么?看起来它正在返回 HTML,可能是错误页面? -
已解决:我可以使用stackoverflow.com/a/21823343/1451512 来修复它。