单击jtree节点时打开多个窗口

open multiple windows when clicked on jstree node

本文关键字:窗口 jtree 节点 单击      更新时间:2023-09-26
$(document).ready(function(){
     $("#tree").jstree({  
         "xml_data" : {  
             "ajax" : {  
                 "url" : "jstree.xml"            
             },  
             "xsl" : "nest"
             },  
    "themes" : {  
             "theme" : "classic",  
            "dots" : true,  
             "icons" : true 
         },  
          "ui": {
            "initially_select" : [ "#1234" ] 
       },
    "search" : {  
              "case_insensitive" : true,  
                 "ajax" : {  
                     "url" : "tree.xml" 
                 }  
             }, 
    "plugins" : ["themes", "xml_data", "ui","types", "search", "cookies"],
    "core" : { "initially_open" : [ "12345" ] } 
    }).bind("select_node.jstree", function (event, data) {
            var node_id = data.rslt.obj.attr("id");
            $.cookie("example", node_id, { path: '/', expires:7 });
            window.open('new.html', '_newtab','width=800,height=1000,resizable=1,scrollbars=1');
    });

我正在尝试jstree来填充树,当单击节点时,我需要启动一个名为new.html的新窗口,使用cookie来存储节点id的值。它的工作原理。但我需要的是,当单击jtree节点时,我需要一个新的new.html窗口并单击另一个节点,而不是更新new.html,我需要另一个带有新node_id的窗口。因此,需要使用new.html为每个node_id多个窗口。这是可能的jquery吗?

使用如下所示的空参数可以达到目的。

window.open('new.html', '','width=800,height=1000,resizable=1,scrollbars=1');