今天在研究Meizz的动态树,有两个地方不明白。javascript的这种写法什么意思?
-----------------------
  this.nodes = {}; this.node["0"] =
  {
    "id": "0",
    "path": "0",
    "isLoad": false,
    "childNodes": [],
    "childAppend": "",
    "sourceIndex": "0"
  };---------------------------------
这两行代码什么意思,谁知道。
全文代码地址:http://topic.csdn.net/t/20050310/23/3841740.html#Top

解决方案 »

  1.   

    相当于一个Array的第一个元素是
    {
        "id": "0",
        "path": "0",
        "isLoad": false,
        "childNodes": [],
        "childAppend": "",
        "sourceIndex": "0"
    }
      

  2.   

    nodes = {}表示声明一个数组 this.node["0"] =
      {
        "id": "0",
        "path": "0",
        "isLoad": false,
        "childNodes": [],
        "childAppend": "",
        "sourceIndex": "0"
      };
    这个表示node的第一个元素.是个枚举类型.id = 0,path=0...
      

  3.   

    第一个元素应该是对象直接量,也就是json中的一种数据类型
    http://www.json.org/json-zh.html
      

  4.   

    this.node =
      {
        "id": "0",
        "name": "aaa"
      };
        alert(node.id);
       alert(node.name);
      

  5.   

    var tree = new MzTreeView("tree");
              tree.setIconPath("./");
              tree.nodes['0_1'] = 'text:节点 1';
              tree.nodes['1_2'] = 'text:节点 2';
              tree.nodes['1_3'] = 'text:节点 3';
              tree.nodes['1_4'] = 'text:节点 4';
              tree.nodes['1_5'] = 'text:节点 5';
              tree.nodes['1_6'] = 'text:节点 6';
              tree.nodes['1_7'] = 'text:节点 7';
              tree.nodes['1_8'] = 'text:节点 8';
              tree.nodes['1_9'] = 'text:节点 9';
              tree.nodes['1_10'] = 'text:节点 10';
    ------------------
     这又是什么意思
      

  6.   

    看看javascript教程,Array那一章。
      

  7.   

    看看javascript教程,Array那一章。
      ------------------------
        我看的这本书上没有这章~!
           在那里看?
      

  8.   

    看看javascript教程,Array那一章。
      ------------------------
        我看的这本书上没有这章~!
           在那里看?
    网上搜一下
      

  9.   

    《javascript高级编程》,CSDN里有连载