Dragnovich
Dragnovich

Reputation: 91

Problems Loading jQuery from CDN

I have written an intranet site, and it relies heavily on jQuery. To load jQuery I have been loading it from the jquery.com CDN and it works well. However, it has been reported by some users (using Firefox) that they can't use my site.

Debugging, I found that they all get a 404 error when trying to load the jQuery from here:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>

However, I'm using Firefox and have no problems with it.

Any idea why some users are having trouble?

Upvotes: 0

Views: 1911

Answers (2)

user3402248
user3402248

Reputation: 469

As Eric says it is better to load JQuery from a local web server. And always ensure that you first list the path to your JQuery library and then mention the path to the JQuery file. I have explained this here JQuery CDN Issue

Upvotes: 0

Eric J.
Eric J.

Reputation: 150208

If this is an intranet application as you state, it is best to load jQuery from the local web server. It will be much faster than going to a CDN.

You might well get this error if outbound firewall rules prevent connecting to the URLs listed in the CDN. Try entering the URL of one of the JS files in the browser bar and see if you get a message from the firewall. Also try observing the connection in the developer tools window (e.g on Internet Explorer press F12, then select Network tab).

Upvotes: 3

Related Questions