谷歌浏览器正常,ie11按f12查看出现 对象不支持“createNSResolver”属性或方法
以下是我处理步骤:
1.createNSResolver 先去找这个方法对应的js (本来以为是ie11不支持,想找可替换的方法);
2.其实是引用这个js的地方做的判断;
以我自己的例子如下 base.js 是压缩过的js https://tool.lu/js/ 可以比较直观
js代码:
var Br = {};
var u = navigator.userAgent.toLowerCase();
Br.ie = ( !! window.ActiveXObject || "ActiveXObject" in window) ? true : false;
Br.ieVer = Br.ie && parseFloat(u.substr(u.indexOf('msie') + 5));
Br.gck = /gecko/i.test(u);
Br.chm = /chrome/i.test(u);
Br.fox = /firefox/i.test(u);
Br.saf = /safari/i.test(u);
Br.opa = /opera/i.test(u);
Br.ie6 = Br.ie && Br.ieVer >= 6;
Br.ie7 = Br.ie && Br.ieVer >= 7;
Br.ie8 = Br.ie && Br.ieVer >= 8;
Br.ie9 = Br.ie && Br.ieVer >= 9;
Br.ie10 = Br.ie && (Br.ieVer >= 10 || document.documentMode >= 10);
Br._ie6 = Br.ie6 && Br.ieVer < 7;
Br._ie7 = Br.ie7 && Br.ieVer < 8;
Br._ie8 = Br.ie8 && Br.ieVer < 9;
Br.ie_7 = Br.ie && Br.ieVer < 8;
Br.ie_8 = Br.ie && Br.ieVer < 9;
Br.cmp = (Br.ie8 || Br.gck || Br.opa) && document.documentMode != 7;
Br.w3c = Br.ie10 || Br.gck || Br.opa;
Br.webkit = (u.indexOf(' applewebkit/') > -1);
Br.font = 6;
Br.select = null;
Br.auto = Br.scroll = Br.ie ? 17 : 19;
Br.miniscroll = 6;
Br.iedm = function(a) {
return Br.ie && (a ? $.dc(a) : document).documentMode == 7;
}
ie浏览器在 Br.ie 判断 true or false ie11的时候 Br.ie = ( !! window.ActiveXObject || "ActiveXObject" in window) ? true : false;
在f12调试 "ActiveXObject" in window输出为true。
添加这个判断解决。