1

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

Solved https://stackoverflow.com/a/21823343/1451512

Community
  • 1
  • 1
dopplesoldner
  • 8,891
  • 12
  • 44
  • 55
  • What happens when you point your browser to `http://localhost:8080/bower_components/jquery/jquery.js`? Looks like it's returning HTML, perhaps an error page? – Anthony Chu Feb 27 '14 at 23:38
  • Solved: I was able to use http://stackoverflow.com/a/21823343/1451512 to fix it. – dopplesoldner Feb 27 '14 at 23:40

1 Answers1

0

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.

bigblind
  • 12,539
  • 14
  • 68
  • 123