jsTree xml_数据插件在IE11中不起作用
jsTree xml_数据插件在ie 11中不起作用。它在每个浏览器(包括ie10)中都能很好地工作,但在ie11中却不行。没有错误消息,只有“加载”永远 有人经历过吗?到目前为止,我在网上还没有找到任何关于jsTree和ie11的参考资料jsTree xml_数据插件在IE11中不起作用,jstree,internet-explorer-11,Jstree,Internet Explorer 11,jsTree xml_数据插件在ie 11中不起作用。它在每个浏览器(包括ie10)中都能很好地工作,但在ie11中却不行。没有错误消息,只有“加载”永远 有人经历过吗?到目前为止,我在网上还没有找到任何关于jsTree和ie11的参考资料 谢谢你的帮助 在jstree.js文件中有以下函数: (function ($) { $.vakata.xslt = function (xml, xsl, callback) { var rs = "", xm, xs, processor, su
谢谢你的帮助 在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 || "ActiveXObject")
希望这是有道理的
编辑:
将if语句更改为以下内容,因为早期的修复程序在Chrome上导致问题:
if (window.ActiveXObject !== undefined || "ActiveXObject" in window)
太好了,很好用!我的jstree版本有点不同:
if(r==false&&(window.ActiveXObject){
变成if(r==false&(window.ActiveXObject | |“ActiveXObject”){
但它的工作原理是一样的。
if (window.ActiveXObject || "ActiveXObject")
if (window.ActiveXObject !== undefined || "ActiveXObject" in window)