0

I have AJAX code for my API. Chrome is OK, but IE is not working. When I changed the document mode of IE 8 to IE 10/Edge, it worked.

NB: We use IE 11, but the default Document mode is IE 8.

How can I fix this?

Here is the error I found, when I debugged:

Object doesn't support property or method 'addEventListener'

  • What version of SharePoint? IE8 is not supported in 2016 or SPO. – Trevor Seward Dec 14 '17 at 18:13
  • SharePoint 2010 – Sai Dec 14 '17 at 18:15
  • youll have to use jquery 1.12, and avoid using html5 specific controls. – Mike Dec 14 '17 at 18:23
  • 1
    Here's a StackOverflow question about this. From what they say, you cannot use 'addEventListener' in IE8, you'll have to use 'attachEvent'. stackoverflow.com/questions/9769868/… – Marc-André Dec 14 '17 at 18:24
  • @Mike, I did that, but not working as well – Sai Dec 14 '17 at 18:29
1
  1. Add this little bit of code to the bottom of your Master Page, just before the closing <body> tag.

    <script language="javascript">
        /* IE11 Fix for SP2010 */
        if (typeof UserAgentInfo.strBrowser !== 'undefined' && !window.addEventListener) {
            UserAgentInfo.strBrowser=1;
        }
    </script>
    
  2. Click the Close button to close the error message. Find Internet Explorer Tools. Choose Compatibility View Settings. Add URL of site, accept changes and Close. Refresh the page and try to open the site now.

  3. If the issue is still existing, you can try to change the settings in Internet Explorer and check. Open Internet Explorer, click on Tools. Click on Internet Options, click Advanced tab. Make sure there is a check mark for these options:

    • Disable script debugging (Internet Explorer)
    • Disable script debugging (Other)
    • Uncheck Display notification about every script error. Click Apply and OK. Restart the Internet Explorer and check the issue.
  4. Try to disable enhanced protected mode and check.

    • Click the Tools icon in Internet Explorer. Go to Internet Options, click Advanced tab and select the Security section and uncheck the check box beside Enable Enhanced Protected Mode (requires restarting Internet Explorer). Click on Apply and then click OK.
  5. Also try to add the websites to trusted sites list and check.

    • Open Internet Explorer, click on Tools and then click on Internet Options. Click on the Security tab. Now click on Trusted sites and then click on sites button. Type the URL of the website in the text box and click on the Add button. When you’re done, click on Close.

SharePoint 2013 Troubleshooting: Object doesn't support property or method 'addEventListener' or 'getAttribute'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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