IE8 is throwing error with jQuery

15,972

Solution 1

jQuery 2.0 dropped support for some browsers. See the release post at http://blog.jquery.com/2013/04/18/jquery-2-0-released/

Quoting from the post:

No more support for IE 6/7/8: Remember that this can also affect IE9 and even IE10 if they are used in their “Compatibility View” modes that emulate older versions. To prevent these newer IE versions from slipping back into prehistoric modes, we suggest you always use an X-UA-Compatible tag or HTTP header. If you can use the HTTP header it is slightly better for performance because it avoids a potential browser parser restart.

Reduced size: The final 2.0.0 file is 12 percent smaller than the 1.9.1 file, thanks to the elimination of patches that were only needed for IE 6, 7, and 8. We had hoped to remove even more code and increase performance, but older Android/WebKit 2.x browsers are now the weakest link. We’re carefully watching Android 2.x market share to determine when we can cross it off the support list, and don’t expect it to take very long.

Keep jQuery 1.9 (Edit 2015-11-17: jQuery 1.11.3 is the current 1.x version of jQuery.) if IE 6/7/8 are a concern.

Solution 2

use the code in the below linked gist in your html file and add both jquery 2.0+ for latest browser and 1.9 for older browsers

https://gist.github.com/dwoodiwiss/5633393

Share:
15,972
DS.
Author by

DS.

Updated on June 27, 2022

Comments

  • DS.
    DS. almost 2 years

    I'm facing some issue with IE7/IE8 and jQuery. My code works in IE 10, FF, Chrome, Safari, Mobile Safari, Mobile Chrome.

    For now, to debug, I've removed my own JS file. So here's the code:

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
    

    There is no other JS referenced on this page. I've removed all other JS reference and there is no JS executed on the page itself. When the page loads in IE8, I get this error:

    Line: 4
    Error: Object doesn't support this property or method
    

    enter image description here

    The debugger shows the above. Not sure where the issue is. Any help is greatly appreciated.

    P.S. - This is my first 'serious' web development effort and I see now why IE is hated so much in the dev community.