<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script src="scripts/vendor/require.js"></script>
</body>
</html>
var d;
That is all there is. The file used to be require.js from their main site. But I deleted everything trying to figure out what was going on. I then deleted the whole file and created a new file (with the same name). Could I have changed something with Chrome to make in interpret files this way? I can't reproduce the problem with any of my other projects. I also originally downloaded the file using jam. Really I could just start a new project folder and probably solve the problem but I am curious as to why it would do this. Maybe something stupid simple since I am new to this.
It was a encoding problem with my index.html file (I re-saved the file with UTF-8 encoding and the problem went away). Thanks for your help.
The problem is that the master file and the linked script file must have the same encoding, otherwise Chrome browser will not be able to load it correctly.
For example, if the html file is encoded in UTF-16 LE and the javascript file in UTF-8, then Chrome will silently assume that the javascript file is also in UTF-16 LE and fails to load it.
You can add a charset attribute to the script element to hint about encoding and in such case, Chrome will load it correctly:
<html>
<head><title>Test</title> </head>
<body>
<script type="text/javascript" charset="UTF-8" src="script.js"></script>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With