JSFiddle - React, Tailwind, and code Playground
HTML
<div id="answerPlaceHolder"></div>
<script>
var placeHolder = $('#answerPlaceHolder');
var url = 'https://api.vk.com/method/wall.get?owner_id=-78812318&count=20&filter=all&v=5.45';
var answer;
$.ajax
({
url: url,
type: 'get',
crossDomain: true,
dataType: 'jsonp',
success: function(response)
{
answer = response;
var counter = 1;
answer.response.items.forEach(function(item) {
// console.log('Пост № ' + counter);
var post = $("<div class='post'>");
placeHolder.append(post);
if ((item.text != 'undefined') && (item.text != '')) {
post.append('<div class="blog-header">' + item.text + '</div>');
//console.log(item.text);
}
// console.log(item);
if ((typeof(item.attachments) !== 'undefined') &&
(item.attachments[0].type == 'photo') &&
(typeof(item.attachments[0].photo.photo_604) !== 'undefined')) {
post.append('<img width="560px;" src="' + item.attachments[0].photo.photo_604 + '"> <div class="blog-share"><a href="http://gamer-by-life.com/share/?title=' + item.text + '&img=' + item.attachments[0].photo.photo_604 + '&time=' + item.date + '"><img src="share.png"></a></div>');
// console.log(item.attachments[0].photo.photo_604);
}
counter++;
console.log('******************************\n');
post.append('<br>');
});
},
error: function(error)
{
console.log('Ошибка');
console.log(error);
}
});
</script>