我有一个像这样在JavaScript字符串变量:树形[{“id”:1},{“id”:2,“children”:[{“id”:3},{“id”:4},{“id”:5,“孩子 “:[{” ID“:6}]}]
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的。 变量。
你能更具体吗?一个'树'是一个'数据结构' - http://stackoverflow.com/questions/8640823/what-javascript-tree-data-structures-are-available。你究竟需要什么? – 2013-03-14 12:06:55
你想从树上做树! – Diode 2013-03-14 12:09:36