我在 IE 和 chrome 中检查了许多关于 jsTree 问题的线程,但没有一个解决方案对我有帮助。
我在我的文件中放置了正确的文档类型。我采用了纠正“”错误的最后一个版本。
但在 IE 和 chrome 中仍然没有任何内容(甚至没有“正在加载...”消息),但在 Firefox 中运行良好(无论 3 个浏览器的版本如何)。
您可以使用以下地址在不同的浏览器中直接生成和观察此错误:http: //lbgi.igbmc.fr/orthoinspector/dbquery/ ?stype=text
这是我的树初始化代码(在 jquery 脚本中):
var compressedTreeSkeleton = generateCompressedJSONData(organismTreeSkeleton);
// Generate the tree. Data provided is JSON (JavaScript Object Notation).
$(function(){
$("#treeview").jstree({
"json_data" : { "data" : compressedTreeSkeleton },
"types" : {
"types" : {
"inner_node" : {
"icon" : {
"image" : "images/node_icon_closed.png"
}
},
"leaf_node" : {
"icon" : {
"image" : "images/leaf_icon_1.png"
}
}
}
},
"search" : {
"case_insensitive" : true
},
"plugins" : ["themes", "ui", "json_data", "checkbox", "types", "search"]
});
});
}
这是这段代码第一行生成的对象的概述(变量compressedTreeSkeleton),从chrome控制台输出中提取(您也可以在网站上直接在线查看)。它是一个“对象”表,每个表都包含树的一个节点的信息。此信息(对象)是在创建树之前通过 postgresql 数据库查询生成的。
[ Object {
date: "2029-05-01"
genus: "Oryza"
identifier: "LOC"
phylo_order: "59"
phylum: "Eukaryota;Viridiplantae;Streptophyta;Streptophytina;Embryophyta;Tracheophyta;Euphyllophyta;Spermatop…"
pk_bank: "1"
pk_organism: "1"
species: "sativa"
taxid: "39947"
__proto__: Object } ,
Object, Object, Object, Object, (...) ]
在 chrome 控制台中启动以下错误:
Uncaught TypeError: Object [object Object] has no method 'jstree'
而这个在 IE 中:
Object doesn't support this property or method
在 Firefox 中运行良好...
我迷失了这一切。知道我应该在哪里看吗?感谢您的建议。