Internet Explorer Compatibility with HTML

3

I have a drop-down list, when using Edge emulation and 10 it works without problem.

When using the emulation of 9, 8 and 7 does not work.

They could explain to me why this situation happens and how to solve the problem.

    
asked by ARR 30.08.2018 в 17:57
source

2 answers

2

In the absence of time googletrasnlateo link

Internet Explorer 8 and earlier are not compatible with getElementsByClassName() . If you only need one solution for IE8, it supports querySelectorAll() . For older IE versions, you must provide your own implementation, and for some older browsers that support it you can also use evaluate() that executes XPath expressions.

This code provides a document.getElementsByClassName method if it does not already exist using the methods that kapa has described:

if (!document.getElementsByClassName) {
  document.getElementsByClassName = function(search) {
    var d = document, elements, pattern, i, results = [];
    if (d.querySelectorAll) { // IE8
      return d.querySelectorAll("." + search);
    }
    if (d.evaluate) { // IE6, IE7
      pattern = ".//*[contains(concat(' ', @class, ' '), ' " + search + " ')]";
      elements = d.evaluate(pattern, d, null, 0, null);
      while ((i = elements.iterateNext())) {
        results.push(i);
      }
    } else {
      elements = d.getElementsByTagName("*");
      pattern = new RegExp("(^|\s)" + search + "(\s|$)");
      for (i = 0; i < elements.length; i++) {
        if ( pattern.test(elements[i].className) ) {
          results.push(elements[i]);
        }
      }
    }
    return results;
  }
}
    
answered by 31.08.2018 / 05:51
source
0

try this tag to be compatible with EI

<meta http-equiv="X-UA-Compatible" content="IE=7" />
    
answered by 30.08.2018 в 18:40