按钮显示动态树

var mytree = new dTree('mytree');
$(function(){
$("#btn").bind("click",function(event){
 
    $.getJSON('tree.htm', function(data){
        $.each(data.tree, function(index, value){
            var id = value.cid;
            var pid = value.parent;
            var name = value.name;
            mytree.add(id, pid, name);
        });
		alert(mytree);
		
		$(".dtree").append(document.write("mytree"));
    });
	});
})

你可能感兴趣的:(java)