Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jstree json_数据AJAX加载不会在单击时展开树_Ajax_Json_Jstree - Fatal编程技术网

jstree json_数据AJAX加载不会在单击时展开树

jstree json_数据AJAX加载不会在单击时展开树,ajax,json,jstree,Ajax,Json,Jstree,我正在使用带有ajax加载的“json_数据”插件 我当前的问题是,当我单击“+”符号时,它会发出ajax请求并加载子树,但不会显示它。我必须再单击一次才能展开它 若我看一下演示页面,它会在ajax加载的情况下通过单击扩展树。 我正在使用jstree-v.pre1.0和jquery 1.6.2 这是我的密码: jQuery("#demo").jstree({ // List of active plugins "plugins" : [

我正在使用带有ajax加载的“json_数据”插件

我当前的问题是,当我单击“+”符号时,它会发出ajax请求并加载子树,但不会显示它。我必须再单击一次才能展开它

若我看一下演示页面,它会在ajax加载的情况下通过单击扩展树。 我正在使用jstree-v.pre1.0和jquery 1.6.2 这是我的密码:

jQuery("#demo").jstree({
            // List of active plugins
            "plugins" : [
                    "themes","json_data","ui","cookies"
            ],
            "json_data" : {
                "data" : t,
                "ajax":{
                    "url" : wgScript + "?title=Special:GetChildren",
                    "data": function(n) {
                    return { id: n.attr ? n.attr("id") : 0 };
                }
            }

            },
            "core" : {
                  },
            "themes" : {
                    "theme" : "classic",
                    "dots" : true,
                    "icons" : true
            },
            "cookies" :
            {
                    "auto_save" : true
            }

           });  
有人知道如何解决这个问题吗? 谢谢

更新: jquery版本被证明是罪魁祸首。打开树使用“addBack”函数,该函数仅在>=1.8版本的jquery中可用。我将jquery更新为1.9.1,它解决了这个问题