Saturday 5 November 2016

Object doesn't support property or method "attachEvent" in Internet Explorer 11.

I am getting this error on my SharePoint site, which breaks many functionality, like the list AddNew form UI, which is coming out distorted in IE. The error is due to the fact that "attachEvent" is a deprecated function. This error is occurring in the init.js file, which is provided out-of-the-box by SharePoint.

Google Chrome and Mozilla Firefox are handling this error, but IE is unable to do that.

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

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


🚀 "Happy Coding" 🚀

2 comments:

  1. i tried using this code it is returning me with Syntax error.(line 3, file "Code")

    Can you help me out what i did wrong? I just copied and paste.

    ReplyDelete
    Replies
    1. Sorry for replying late.
      Please check the version of IE browser it should be 11 or above.

      Delete