• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 關于javascript樹形結構的編寫問題

    發表于:2008-05-30來源:作者:點擊數: 標簽:JavaScriptJavascriptjavascript樹形結構
    關鍵字: java script 編寫問題 function branch(id, text){ this.id = id; this.text = text; this.write = writeBranch; this.add = addLeaf; this.leaves = new Array(); this.getid=getid; } function getid(){return this.id;} function addLeaf(leaf){
    關鍵字:javascript 編寫問題

    function branch(id, text){
    this.id = id;
    this.text = text;
    this.write = writeBranch;
    this.add = addLeaf;
    this.leaves = new Array();
    this.getid=getid;
    }
    function getid(){return this.id;}

    function addLeaf(leaf){
    this.leaves[this.leaves.length] = leaf;
    }

    function writeBranch(){
    var branchString =
    '< span class="branch" ' + onClick="showBranch(this.getid())"';

    //編譯的時候出現了this.getid()必須要賦予一個變量的問題,也就是左值問題

    求教?。。。。。。?!
    branchString += '>< img src="plus.gif" id="I' + this.id + '">' + this.text;
    branchString += '< /span>';
    branchString += '< span class="leaf" id="';
    branchString += this.id + '">';
    var numLeaves = this.leaves.length;
    for (var j=0;j< numLeaves;j++) branchString += this.leaves[j].write();
    branchString += '< /span>';
    return branchString;
    }

     

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>