B
B
blackdracon2017-09-10 16:29:42
PHP
blackdracon, 2017-09-10 16:29:42

How to write an array to a variable from an external file?

var root = {
    "name": "Direct",
        "children": [{
        "name": "analytics",
            "children": [{
            "name": "cluster",
                "children": [{
                "name": "AgglomerativeCluster",
                    "size": 3938
            }, ....продолжение кода 
};

Advise how to write array data (represented in the code) from an external file to the root variable.
What an idea: Make a table with the values: "Direct, analytics, etc.", so that any user can change them. And pass them in a structured form to the root variable, where they will already be displayed in the form of a tree.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
oh, 2017-09-10
@blackdracon

read about json
and look for js plugins that build treeview

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question