jstree inline HTML demo

by Ivan Bozhanov

HTML

<script src="https://static.jstree.com/latest/assets/dist/jstree.min.js"></script>
<link rel="stylesheet" href="https://static.jstree.com/latest/assets/dist/themes/default/style.min.css">
<div id="container"></div>

JavaScript

$('#container').jstree({
    'core' : {
        'data' : {
            "url" : "//www.jstree.com/fiddle/?lazy",
            "data" : function (node) {
                return { "id" : node.id };
            }
        }
    }
});

/*
This demo uses CORS (requests data from jstree.com, while you are on jsfiddle.net).
In order not to overcomplicate things it will not work on IE8 / IE9.

HOWEVER IF REQUESTING FROM THE SAME DOMAIN THERE WILL BE NO PROBLEM IN THOSE BROWSERS.

CORS AND JSONP WILL ALSO WORK FINE IN THOSE BROWSERS TOO, BUT IT IS OUT OF THE SCOPE OF THIS DEMO
*/