Questioner
Questioner

Reputation: 7463

Why am I getting a 404 error for a javascript file that is right where it should be?

I have a website that is failing to load properly because required javascript files are not being found.

Firebug is showing me an error that says:

"NetworkError: 404 Not Found - http://local_mysite.com/javascript/includes.js"

And yet, includes.js is right there in the javascript directory.

The permissions on the file are -rwxr-xr-x, and the javascript directory is -rwxr-xr-x. I'm not sure if that's correct, but it seems to indicate they are viewable and executable. This is testing on my local server, an Ubuntu 14.04 LAMP setup. This was working before, but it's been a few months since I've worked with these files, so I don't know what might have changed in the meantime.

The reference in my index.html file looks like this:

<script type="text/javascript" charset="utf-8" src="javascript/includes.js"></script>

Why can't my index.html find the includes.js file?

Upvotes: 2

Views: 3442

Answers (2)

captain_jim1
captain_jim1

Reputation: 1001

Edit: Try renaming your javascript directory to something else. You may be having an alias problem within apache.

I am going to guess that you're running into a same-origin policy error. Try making your markup reference the file relatively.

Upvotes: 2

FBarawi
FBarawi

Reputation: 51

make sure paths are correct and don't forget it is case-sensitive, also make sure if there is paths inside the includes.js are correct, and it is in the same site.

Upvotes: -1

Related Questions