您现在的位置是:首页 > 电脑技术查询 > web开发

新手请问json有关问题

编辑:chaxungu时间:2022-10-02 23:19:00分类:web开发

新手请教json问题
这是从服务端返回的json串
[

{ "text ": "新建分类 ", "path1 ": "0 ", "id ": "30 ", "cls ": "folder ", "leaf ":false, "children ":

[

{ "text ": "新建分类 ", "path1 ": "30 ", "id ": "31 ", "cls ": "folder ", "leaf ":false, "children ":

[

{ "text ": "123 ", "path1 ": "30 ", "id ": "35 ", "cls ": "folder ", "leaf ":false, "children ":

[

{ "text ": "123 ", "path1 ": "30 ", "id ": "36 ", "cls ": "folder ", "leaf ":false, "children ":

[

{ "text ": "新建分类 ", "path1 ": " ", "id ": "39 ", "cls ": "folder ", "leaf ":false, "children ":

[

{ "text ": "新建分类 ", "path1 ": " ", "id ": "40 ", "cls ": "file ", "leaf ":true }

]

}

]

},

{ "text ": "000000 ", "path1 ": "0 ", "id ": "34 ", "cls ": "file ", "leaf ":true }

]

},

{ "text ": "新建分类123 ", "path1 ": " ", "id ": "38 ", "cls ": "file ", "leaf ":true }

]

}

]

},

{ "text ": "新建分类 ", "path1 ": "31 ", "id ": "32 ", "cls ": "file ", "leaf ":true }

]

在例子里可以node.id取到id的值,我自己增加了一个path1的字段,但用node.path取不到,怎样才能取到这个值?
谢谢

------解决方案--------------------
我自己增加了一个path1的字段,但用node.path取不到
------------------------------------------------
前边是path1,后边是path