posts - 35,  comments - 6,  trackbacks - 0

function addNode() {


 if (tree.getSelected()) {
  treeid = tree.getSelected().para;   
  arr_ = tree.getSelected().childNodes;
  //if (layer==0) return;
  if(arr_.length > 0) {
    ////////
  }else{
   //new_ = tree.getSelected().add(new WebFXTreeItem('sohu','www.sohu.com'));
   http_request = false;
   if (window.XMLHttpRequest) { // Mozilla, Safari, ...
      http_request = new XMLHttpRequest();
      if (http_request.overrideMimeType) {
       http_request.overrideMimeType('text/xml');
      }
   } else if (window.ActiveXObject) { // IE
     try {
     http_request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
     try {
      http_request = new ActiveXObject("Microsoft.XMLHTTP");
     } catch (e) {}
    }
   }

   if (!http_request) {
      alert("http_request 对象为空!");
      return false;
    }
   http_request.onreadystatechange = function() {
    if (http_request.readyState == 2) {
     // 正在装载
    }else if (http_request.readyState == 4) {
       // 完成
       if (http_request.status == 200) {
      resStr = http_request.responseText;
      if (resStr==""){
        array_ = new Array(0);
      }else{
        array_ = resStr.split("§№☆");
      }
      //alert(resStr);
      //alert("个数="+array_.length);
      for(i=0;i<(array_.length);i++){
          obj=array_[i].split("■△▲");
       nodename = obj[0];
       actions = obj[1];
       paras=obj[2];
       //alert(nodename+"  "+actions+"  "+paras);
       tree.getSelected().add(new WebFXTreeItem(nodename,actions,paras));
      }
     } else {
      alert("返回值错误!");
     }
    } else {
       // still not ready
    }
   };
   var url="<%=request.getContextPath() %>/skeleton/organization.do?todo=contentTreeAction&treeid="+treeid;  
   http_request.open('GET', url, true);
   http_request.send(null);
  }
 }
}

posted on 2007-04-17 14:24 NG 阅读(164) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
<2007年4月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿(1)

随笔档案(35)

文章分类(5)

文章档案(2)

新闻档案(5)

java link

搜索

  •  

最新评论

阅读排行榜

评论排行榜