Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Object doesn't support this property or method" error in IE11

I am getting the error

Critical Error: Object doesn't support this property or method addeventlistener

while accessing the InfoPath form page (using InfoPath enabled list form e.g. displayifs.aspx) in IE 11 browser.

This error is specific to IE 11, the page is opening properly in IE 10 and below. According to this MSDN post, IE 11 supports addEventListener.

Anybody have an idea on this?

like image 730
VSP Avatar asked Sep 16 '13 13:09

VSP


2 Answers

This unfortunately breaks other things. Here is the fix I found on another site that seemed to work for me:

I'd say leave the X-UA-Compatible as "IE=8" and add the following code to the bottom of your master page:

<script language="javascript">     /* IE11 Fix for SP2010 */     if (typeof(UserAgentInfo) != 'undefined' && !window.addEventListener)      {         UserAgentInfo.strBrowser=1;      }  </script> 

This fixes a bug in core.js which incorrectly calculates that sets UserAgentInfo.strBrowse=3 for IE11 and thus supporting addEventListener. I'm not entirely sure on the details other than that but the combination of keeping IE=8 and using this script is working for me. Fingers crossed until I find the next IE11/SharePoint "bug"!

like image 50
user3116631 Avatar answered Sep 16 '22 11:09

user3116631


Best way to solve this until a fix is available (if a fix comes) is to force IE compatibility mode on the user.

Use <META http-equiv="X-UA-Compatible" content="IE=9"> ideally in the masterpage so all pages in your site get the workaround.

like image 34
Chris R Avatar answered Sep 18 '22 11:09

Chris R