26

I am using Jquery 2.0.2 and I have an error in IE8:

Object doesn't support property or method 'addEventListener' jquery.min.js, line 4 character 6105

Somehow all my codes are fine with chrome and firefox, except for ie8.

Getting these errors also resulted to:

The value of the property '$' is null or undefined, not a Function object

I included the query on top of other js files I have using:

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> 

I know Jquery2+ doesnt support IE8, but I dont want to use a lesser version of Jquery.

1
  • what is the code piece that causes this error ? Commented Aug 20, 2013 at 4:59

3 Answers 3

39

jQuery 2.x has dropped support for IE < 9, so if you want to support IE7 & 8 then use latest version of 1.x branch - now 1.11.0

From jQuery

jQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8. All the notes in the jQuery 1.9 Upgrade Guide apply here as well. Since IE 6/7/8 are still relatively common, we recommend using the 1.x version unless you are certain no IE 6/7/8 users are visiting the site.

Sign up to request clarification or add additional context in comments.

1 Comment

Do keep in mind that the difference between jQuery 1.x and 2.x are not only deprecated support for <IE9. Future bug fixes by jQuery related to non-web-site scenarios will only be taken care of in 2.x, as stated by jQuery: With the release of jQuery 2.0, there are a few environments where the jQuery team will no longer support use of the 1.x line because 2.x is a far better choice. These are typically non-web-site scenarios where support for older IE isn’t relevant.
11

jQuery 1.9 is equivalent to jQuery 2.0 as far as functionality, bug fixes, etc. They are both actively developed.

The only difference is code that provides IE compatibility was removed to make the file size and execution speed better.

If you would like to use different jQuery versions depending on the browser, you can use a conditional tag, like this.

<!--[if !IE]> --> <script src="jquery-2.0.0b2.js"></script> <!-- <![endif]--> <!--[if IE]> <script src="jquery-1.9.1.js"></script> <![endif]--> 

Note the styntax highlighting. The first is just two comments that are siblings of the script tag, and the latter is a comment with the script tag inside it. Browsers just follow the rules of DOM parsing, and load/execute the first script. IE deviates and won't execute the first, but will execute the latter.

Comments

0

jQuery 2.x has dropped support for IE < 9. However you can use multiple jQuery version in same web page.

This can be done using jQuery.noConflict()

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.