Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Stringify instead of dirty concatenation #356

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,39 +416,39 @@ <h2></h2>
}
];

var json = '[' +
'{' +
'"text": "Parent 1",' +
'"nodes": [' +
'{' +
'"text": "Child 1",' +
'"nodes": [' +
'{' +
'"text": "Grandchild 1"' +
'},' +
'{' +
'"text": "Grandchild 2"' +
'}' +
']' +
'},' +
'{' +
'"text": "Child 2"' +
'}' +
']' +
'},' +
'{' +
'"text": "Parent 2"' +
'},' +
'{' +
'"text": "Parent 3"' +
'},' +
'{' +
'"text": "Parent 4"' +
'},' +
'{' +
'"text": "Parent 5"' +
'}' +
']';
var json = JSON.stringify([
{
"text": "Parent 1",
"nodes": [
{
"text": "Child 1"
"nodes": [
{
"text": "Grandchild 1"
},
{
"text": "Grandchild 2"
}
]
},
{
"text": "Child 2"
}
]
},
{
"text": "Parent 2"
},
{
"text": "Parent 3"
},
{
"text": "Parent 4"
},
{
"text": "Parent 5"
}
]);


$('#treeview1').treeview({
Expand Down