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"));
});
});
})