作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
jsTree xml_data 插件在 ie 11 中不工作。它在每个浏览器(包括 ie10)中都很好用,但在 ie11 中不行。没有错误消息,只有永远的“加载中”。
$("#hierarquia").jstree({
"xml_data" : {"ajax" : {"url" : "XML.asp"}},
"plugins" : ["xml_data"]
});
有人遇到过吗?直到现在我在网上找不到任何关于 jsTree 和 ie11 的引用资料。
感谢您的帮助!
最佳答案
在jstree.js文件中有这个函数:
(function ($) {
$.vakata.xslt = function (xml, xsl, callback) {
var rs = "", xm, xs, processor, support;
// TODO: IE9 no XSLTProcessor, no document.recalc
if (window.ActiveXObject) {
var xslt = new ActiveXObject("Msxml2.XSLTemplate");
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
xmlDoc.loadXML(xml);
xslDoc.loadXML(xsl);
xslt.stylesheet = xslDoc;
var xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.transform();
callback.call(null, xslProc.output);
return true;
}
if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
xml = new DOMParser().parseFromString(xml, "text/xml");
xsl = new DOMParser().parseFromString(xsl, "text/xml");
// alert(xml.transformNode());
// callback.call(null, new XMLSerializer().serializeToString(rs));
}
if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
processor = new XSLTProcessor();
support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
if(!support) { return false; }
xml = new DOMParser().parseFromString(xml, "text/xml");
xsl = new DOMParser().parseFromString(xsl, "text/xml");
if($.isFunction(processor.transformDocument)) {
rs = document.implementation.createDocument("", "", null);
processor.transformDocument(xml, xsl, rs, null);
callback.call(null, new XMLSerializer().serializeToString(rs));
return true;
}
else {
processor.importStylesheet(xsl);
rs = processor.transformToFragment(xml, document);
callback.call(null, $("<div />").append(rs).html());
return true;
}
}
return false;
};
如果
if (window.ActiveXObject)
您需要向其中添加以下内容:
if (window.ActiveXObject || "ActiveXObject")
希望这是有道理的
编辑:
将 if 语句更改为以下内容,因为之前的修复导致 Chrome 出现问题:
if (window.ActiveXObject !== undefined || "ActiveXObject" in window)
关于jsTree xml_data 插件在 IE11 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20285864/
这个问题不太可能帮助任何 future 的访客;它只与一个小地理区域、一个特定时刻或一个非常狭窄的情况相关,而这些情况通常不适用于互联网的全局受众。如需帮助使这个问题更广泛地适用,visit the
jsTree xml_data 插件在 ie 11 中不工作。它在每个浏览器(包括 ie10)中都很好用,但在 ie11 中不行。没有错误消息,只有永远的“加载中”。 $("#hierarqu
我是一名优秀的程序员,十分优秀!