0

Testing my website after updating to the newest version is failing. I have added in the resize-observer-polyfill. Now IE 11 gives me this error: Object doesn't support property or method 'getElementsByClassName'

Checked canIUse and it seems to support this method Also have this at the top of my HTML file:

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- THIS MUST BE THE FIRST TAG OR IT DOESN'T WORK -->
    <meta http-equiv="X-UA-Compatible" content="IE11" />
    <meta charset="utf-8" />
    <meta name="google" content="notranslate" />

My assumption is that I may need to add a polyfill to handle this since it looks like this function is not supported for svgElements? Tried adding this at the top of index.js to polyfill in the function but didn't seem to do anything :(

    document.getElementsByClassName = function (className) {
      return this.querySelectorAll("." + className);
    };
    Element.prototype.getElementsByClassName = document.getElementsByClassName;
  }
sagar
  • 45
  • 6
  • Does this answer your question? [IE 11: Object doesn't support property or method 'getElementsByClassName'](https://stackoverflow.com/questions/56265315/ie-11-object-doesnt-support-property-or-method-getelementsbyclassname) – tevemadar Mar 29 '23 at 21:07
  • But https://stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x-ua-compatible-content-ie-edge-do can be relevant to, like do you have ` ` at the beginning of the HTML? – tevemadar Mar 29 '23 at 21:09
  • The HTML tag at the top contains already and :( – sagar Mar 30 '23 at 14:07
  • It might be time to give up on IE11. Microsoft has. – Heretic Monkey Mar 30 '23 at 14:52
  • I dream of a world where health systems stop using IE --- until then we are forced to support it haha – sagar Mar 30 '23 at 14:55

0 Answers0