IE9 blocking jQuery CDN

4.3k Views Asked by At

I'm having issues with IE9 in our new website. The jQuery files aren't loading. I've tried the CDN on Google initially but have also tried the Microsoft CDN, both failing. I've seen posts about using the latest version of jQuery. I've grabbed the latest (1.6.4) and that's not helped. I understand it's the tracking protection but since this is our 'front end' site it's not like we can get browsers to add our site to their 'white list' or disable tracking protection.

Whilst hosting the files locally is the obvious next step my other concern is that google analytics code is also failing.

Is there a solution to this?

3

There are 3 best solutions below

0
On

Some variations of jhanifen's solution. By using head.js lib we can load jQuery and other libs a bit faster:

<script src="js/libs/head.load.min.js"></script>
<script>
    head.js("https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js",function() {
      window.jQuery || head.js("js/libs/jquery-1.7.1.min.js");
    });
</script>
7
On

Use the implementation of jquery as outlined in http://html5boilerplate.com/.

<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.4.min.js"><\/script>')</script>
0
On

I thought it best to add my results in an answer incase someone hits this and doesn't browse the comments but best to follow the comments from the answer by @jhanifen. I had to use a local copy of jQuery, using the CDN (even on Microsoft's CDN) didn't work.

My google code wasn't sat below the end body tag, it was just above it, rectifying that resolved the issue.

Typekit, I had to use conditionals, but then that defeats the object of using Typekit, especially considering you'd think IE9 was 'a modern browser'. Crazy!

I've queried Typekit to see if they have a work around and will edit this if they come back with anything helpful.