3

After editing a form in InfoPath for use on a SharePoint 2010 site, my page will no longer load on IE11. On all other browsers, it is fine, but before the page can load in IE11, I receive a "Critical Error" message that states: "Object doesn't support property or method 'addEventListener'". According to a StackOverflow post that I found (https://stackoverflow.com/questions/18829292/object-doesnt-support-this-property-or-method-error-in-ie11), the solution to this problem is to either run IE11 in compatibility mode or to insert the following code in the Master Page"

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

I would rather not ask all my users to run their IE11 in compatibility mode, and I currently don't have access to the Master Page. Does anyone know if there is any workaround that I can use to solve this problem aside from the two previously mentioned solutions?

EDIT: Changed script.

1
  • Note that there should be a </script> at the end of this HTML snippet.
    – Hutch
    Commented Mar 11, 2016 at 0:17

6 Answers 6

2

We've run into this problem and have had to fix it via the master page. If you don't have that luxury, the only other thing I can think of is to have the IT folks set up a group policy to enforce it globally.

http://msdn.microsoft.com/en-us/library/dn321457.aspx

1

Adding the javascript to the master page is ideal, but if that is not an option, then an alternative is to use Content Editor Web Parts.

  1. Add a text file to a library containing the JavaScript snippet. (One place to put it could be the Site Assets library.
  2. On each page that has an InfoPath form, add a Content Editor Web Part. Assign the CEWP to read its source from a file, specifying the path to the text file you added in Step 1.
1
  • This or the Code Snippet web part should be the solution. Makes it super-easy to do client-side rendering modifications.
    – thanby
    Commented Jan 5, 2018 at 13:08
1

Facing the same issue, but I just realized that if you activate Enterprise mode in IE you can skip this issue. Hope that helps Regards

0

Adding the site to the IE Compatibility View Setting worked for me.

0

Add the code snippet in JS file used in master page or used globally.

<script language="javascript">
if (typeof browseris !== 'undefined') {
    browseris.ie = false;
}
</script>

For more information refer blog: http://blogs2share.blogspot.in/2016/11/object-doesnt-support-property-or.html

0

Wait for the page to be fully loaded

window.onload=function() {
document.addEventListener("click", function(e){console.log("worked", e);})
}

It worked for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.