Google Hosted jQuery or Other Scripts not working – Google CDN Down

Post 20 of 73

Today we’ve had a flood of errors with customer websites where google hosted jquery and other scripts from loading.

On most PC’s trying to access the Google Content Delivery Network (CDN) will give you a 404 error of the file not found!

If like me you have used Google’s DNS you might be confused because everything is working fine, however it seems OpenDNS has stopped access to the Google Datacenters due to a phishing scam??!?

Seriously? Good way to break half the internet guys!

OpenDNS Credit goes to:

https://twitter.com/#!/matbennett/status/154492602559897600/photo/1

Seems like I would suggest using a fallback script to local, this will then be bulletproof!

This sort of thing would work:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>!window.jQuery && document.write('<script src="js/jquery-1.4.2.min.js"><\/script>')</script>

Or if you’re using MooTools using Google Hoosted / CDN Try this:

<script src=\"http://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js\" type=\"text/javascript\"></script>
<script>!window.MooTools && document.write('<script src=\"js/mootools-yui-compressed.js\"><\/script>')</script>

, , , , , , ,

7 comments:

MatJanuary 4, 2012 at 11:27 amReply

Thanks for the credit Adam. We’re falling back to the Microsoft CDN when Google goes down. I’ve posted an example here: http://geekyscribbles.com/2012/01/google-cdn-gets-blocked-and-how-to-fix-the-problem/ *Should* work !

DJB31stJanuary 4, 2012 at 11:39 amReply

Thanks for the fix… OpenDNS FTW…

AdamJanuary 4, 2012 at 12:03 pmReply

@Mat no problems on the credit you saved us all here a good arguement and a lot of time. Wasn’t even aware Microsoft Hosted jQuery etc! So thanks for that. Think either way will resort to a local hard copy anyway, always the safest way it seems.

M1keJanuary 4, 2012 at 2:57 pmReply

Thanks for blogging this Adam, I was beginning to think I was going crazy, no Twitter or Google searches were pulling anything up for it! I noticed it this morning on someone else’s site and sent them a bug report as I found that the 1.5 version of jQuery had the error but the 1.5.1 version did not. They reported they could not reproduce but changed anyway.

We then noticed it on our sites using 1.7, and again switching to 1.7.1 fixed it. Thankfully it seems to be fixed so I don’t have to update every site but will implement the window.jQuery check to prevent future problems.

ste williams » Sites knocked offline by OpenDNS freeze on GoogleJanuary 5, 2012 at 11:19 amReply

[...] Google’s treasure trove of useful scripts and apps for web developers. According to reports, a flood of errors hit pages that used Google-hosted jQuery and hundreds of thousands of sites fell [...]

Sites knocked offline by OpenDNS freeze on Google | Matias VangsnesJanuary 5, 2012 at 4:01 pmReply

[...] Google’s treasure trove of useful scripts and apps for web developers. According to reports, a flood of errors hit pages that used Google-hosted jQuery and hundreds of thousands of sites fell over.Visitors to [...]

maccad » Sites knocked offline by OpenDNS freeze on GoogleJanuary 5, 2012 at 7:41 pmReply

[...] Google’s treasure trove of useful scripts and apps for web developers. According to reports, a flood of errors hit pages that used Google-hosted jQuery and hundreds of thousands of sites fell [...]

Menu