Topic: Unable to get property 'Contains' when using IE 11

alex9249 pro asked 6 years ago


Hello, I am getting an error when trying to using IE 11. This error only happens when using internet explorer and does now get thrown when using chrome or firefox. The error i am getting is this : Unhandled exception at line 1, column 194946 in /js/mdb.min.js 0x800a138f - JavaScript runtime error: Unable to get property 'contains' of undefined or null reference There was a post similar to the same issue i am having 9 months ago but no solution was found. I am hoping there maybe a solution by now.   Thankss, Alex

alex9249 pro commented 6 years ago

Forgot to add that this is where its breaking in the script file: if(i.classList.contains("waves-effect")&&!(i instanceof SVGElement))

Jakub Strebeyko staff answered 6 years ago


Hi there Alex,

Thanks for reaching out! It seems like the i in the i.classList.contains(... is simply not there, but why exactly (we're looking at you, IE11!) is hard to guess using just presented data - it might have to do with IE11 HTML Parsing (1) or IE11 not granting the .contains() method to SVG elements (1, 2). You can try and share your code here, but [SPOILER ALERT] there's not much we can offer to countermeasure the issue except for shims and polyfills available online.

With Best Regards,
Kuba



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags