日期:2014-05-16  浏览次数:20610 次

姐发现extjs真是太难学了,谁能帮我详细解析下面代码中的①②③④⑤⑥⑦句的意思,70分相送。
Ext.onReady(function(){   ---------------①

    var loader = new Ext.tree.TreeLoader({dataUrl: '01-06-01.txt'});
    loader.processResponse = function(response, node, callback){ ---------------②
        var json = response.responseText;
        try {
            var json = eval("("+json+")");---------------③
            node.beginUpdate();
            var o = json["key"];---------------④

            for(var i = 0, len = o.length; i < len; i++){
                var n = this.createNode(o[i]);
                if(n){
                    node.appendChild(n);
                }
            }
            node.endUpdate();
            if(typeof callback == "function"){---------------⑤
                callback(this, node);---------------⑥
            }
        }catch(e){
            this.handleFailure(response);---------------⑦
        }
    };
}

-------------------
①句中的onReady是什么含义?
②句中的processResponse是什么意思?
③句中的eval是什么意思?

⑥句中的callback是递归调用自己吗?
⑦句是什么意思?

------解决方案--------------------