Internet Explorer 8 and jquery addEventListener

I recently migrated my MVC 4 application from VS2010 to VS2012. I also switched from .Net 4.0 to .Net 4.5, when everything worked, I updated the NuGet packages to the latest stable versions.

It seemed that everything was working fine, but now I was informed that the application does not work with IE8 (IE7), although every other browser looks fine.

The following error will appear: -

SCRIPT438: object does not support property or method 'addEventListener' jquery-2.0.3.js, line 834 character 4

The generated HTML is as follows: -

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> <link href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" rel="stylesheet"/> <link href="/Content/site.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.core.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.resizable.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.selectable.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.accordion.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.autocomplete.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.button.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.dialog.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.slider.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.tabs.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.datepicker.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.progressbar.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.theme.css" rel="stylesheet"/> <link href="/Content/menubar.css" rel="stylesheet"/> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2compact"></script> <script src="/Scripts/jquery-2.0.3.js"></script> <script src="/Scripts/jquery-ui-1.10.3.js"></script> <script src="/Scripts/jquery.validate.js"></script> <script src="/Scripts/jquery.validate.unobtrusive.js"></script> <script src="/Scripts/modernizr-2.6.2.js"></script> </head> 

My search queries show that this method is not supported by IE8, but I'm not sure where to go from here, since the violation code is in the jquery file.

+6
source share
1 answer

You are using jQuery 2.0 which does not support IE8.

If you want to support IE8, you need to stick with jQuery 1.x.

+17
source

Source: https://habr.com/ru/post/950036/


All Articles