Question

I got these three popular scripts included between my <head> tags

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/json3/3.2.6/json3.min.js"></script>
<script type="text/javascript" src="/js/jquery.cookie.js"></script>

When I check for errors in IE7 and 8 I get the following:

  1. 'JSON' is undefined. (IE7)
  2. 'jQuery' is undefined. (IE7 and IE8)
  3. Object doesn't support this property or method. (IE8)

Can anybody tell me what is the cause of this, because I clearly am including those on my page, yet still come up as undefined. I have nothing else yet on my page besides these includes.

How can I fix this?

Was it helpful?

Solution

jQuery 2.0 drops support for IE 6, 7 and 8, and is only meant for when you know you don't need to support those browsers. For most people the correct solution is to use jQuery 1.x instead, which is still officially supported:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top