I have a HTML page and I am trying to include some js files like
<script type="text/javascript" src="../bower_components/jquery/jquery.js"></script>
But I keep getting
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8080/bower_components/jquery/jquery.js".
followed by
Uncaught SyntaxError: Unexpected token < jquery.js:1
in the developer console. I am trying some tutorials on angular.js and node.js
You're including ../bower_components/jquery/jquery.js
as a script, so the browser tries to interpret as a script. The reason it finds a <
is probably because the server can't find a file at that path, and so it returns a 404.
To make sure this is the case, open the developer tools of your browser of choice. Most, if not all browsers have a way to see the requests and their responses. In chrome, you can do this by opening the dev tools and clicking the network tab.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.