0

Im currently trying to get the response array in my console that comes from my Dropbox API. And I want to get that array so that I will display it in my JStree.. I try the console.log(fulltree.entries) to show the array and this is the result console.log I want to get that array in my console to show in my jstree

$(function() {
    var fullTree;
    var url = 'https://api.dropboxapi.com/1/delta';
    var access_token = 'My ACCESS TOKEN IN DROPBOXAPI';
    $.ajax({
        url: url,
        data: fullTree,
        method: "POST",
        dataType: "json", 
        beforeSend: function(request) {
            request.setRequestHeader('Content-Type', 'application/json');
            request.setRequestHeader("Authorization", 'Bearer ' + access_token);
        },
        success: function(fullTree) {
            $('#container').jstree({
                'core': {
                    "data": fullTree.entries,
                    "check_callback": true,
                },
                "plugins": ["themes", "contextmenu", "ui","icon"]
            });
            console.log(fullTree.entries);
        },
        error: function(xhr, ajaxOptions, thrownError) {
            console.log(xhr.status);
            console.log(thrownError);
        }
    });
}); 
2
  • Not clear what you want. Can you elaborate a bit what you need. You have the array with you. Then what? Commented Jan 19, 2017 at 6:05
  • I want to show it in my jstree. because it only showing the 12 folders without the name of the folder in my dropbox
    – user7433355
    Commented Jan 19, 2017 at 6:08

1 Answer 1

1
  1. Convert array to string and then use console.log().

    console.log(JSON.stringify(fullTree.entries));

    Hope this will help.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.