javascript – How to parse the list of posts in the Tumblr API correctly?

Question:

Made a code that parses json from Tumblr.

var category = 'test';
var url='http://api.tumblr.com/v2/blog/cheap-shopping-store.tumblr.com/posts/photo?api_key=un7vSO8fihWm4EyM4ZDbSvg7YvkOv9TQoT3diNvG8BoPXfxsTI&tag=' + category;
  var answer;
  $.ajax
  ({
        url: url,                
        type: 'get',
        crossDomain: true,
        dataType: 'jsonp',
        success: function(parse)
        {
          answer = parse.response.posts; //получаем посты, но не знаю как их поочередно выводить

          console.log(parse.response);

ul.appendChild(docfrag);

        },
        error: function(error)
        {
          console.log('Ошибка');
            console.log(error);
        }
  });

There is a var answer inside, which posts are exactly what I need to display in the console (each post in turn) in this example there are two of them, I need your help, otherwise I can’t figure out how to display them.

Answer:

$.ajax({
    url: url,                
    type: 'get',
    crossDomain: true,
    dataType: 'jsonp',
    success: function(parse) {
        for(var i=0; i<parse.response.posts.length; i++) {
            var post = parse.response.posts[i];
            //Здесь код для создания нового DOM-элемента на основе данных в post
            ul.appendChild(docfrag);
        }
    },
    error: function(error)
    {
      console.log('Ошибка');
        console.log(error);
    }
});
Scroll to Top