You can initialize TreeJS by using the below code:
$("#tree").treejs({
url : 'treejs_data.php',
sourceType : 'html'
});
Where url is the url for the ajax() call.
You can initialize TreeJS by using the below code:
$("#tree").treejs({
sourceType : 'json',
dataSource : jsonObj
});
Where jsonObj is a JSON Object.