$('#jstree_div').jstree({
core:{
check_callback : true,
}
});
var tree="<div id='jstree_div'>";
tree+="<ul>";
tree+="<li id='j1_1' data-jstree='{'opened':true,'selected':true}><a class='jstree-clicked' href='#'> </a></li>";
tree+="";
tree+="</ul>";
tree+="</div>";
appendDiv.append(tree);
&#13;
我正在尝试获取整个JSTree数据,并将其作为xml对象发送到服务器以便能够保存数据。 我试过了
var xmlString = $("#jstree_div").jstree("get_xml");
var xmlDOM = $.parseXML(xmlString);
var DataList =[];
var items = $(xmlDOM).find("li > a");
$.each (items, function(key, val){
DataList.push($(val));
});
&#13;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.1/jstree.min.js"></script>
&#13;
但它给了我一个空数组