【发布时间】:2013-03-14 12:02:16
【问题描述】:
我在javascript中有一个这样的字符串变量:
var tree='[{"id":1},{"id":2,"children":[{"id":3},{"id":4},{"id":5,"children"[{"id":6}]}]';
now i want to create a tree from this in which
# 1 and 2 will at same level
# 3 ,4 ,5 will be the sub nodes of 2.
# 6 will be the sub node of 5.
请帮助通过 javascript 或 jquery 制作树形此树变量。 变量。
【问题讨论】:
-
你能说得更具体点吗?
tree是data structure- stackoverflow.com/questions/8640823/… 。你到底需要什么? -
你想用树做树吗!
标签: javascript