Adding <meta http-equiv=“X-UA-Compatible” content=“IE=9” /> using javascript

前端 未结 5 1496
悲&欢浪女
悲&欢浪女 2020-12-18 11:48

I have a strange problem with IE 10. Many jQuery scripts that are working fine on IE 8, 9, Chrome, firefox and safari but broken on IE 10. Issue came into light only when s

5条回答
  •  轮回少年
    2020-12-18 11:57

    var m = document.createElement("meta");
    m.setAttribute("http-equiv", "X-UA-Compatible");
    m.setAttribute("content", "IE=9");
    document.getElementsByTagName("head")[0].appendChild(m);
    

    But as Teemu hinted, it will most likely not show any effect.

提交回复
热议问题