There is a code that displays posts from the VKontakte group to the "answerPlaceHolder" block, so if I want to also display posts from another VKontakte group, only to another "betaFeed" block, how can this be implemented so that they don't interfere with each other?
<div id="answerPlaceHolder"></div> <div id="betaFeed"></div> <script> var placeHolder = $('#answerPlaceHolder'); var url = 'https://api.vk.com/method/wall.get?owner_id=-78812318&count=4&filter=all&v=5.45'; var answer; $.ajax ({ url: url, type: 'get', crossDomain: true, dataType: 'jsonp', success: function(response) { answer = response; answer.response.items.forEach(function(item) { var item2Append = $('<div class= "blog-post"></div>'); if((item.text != 'undefined') && (item.text != '')) { // item2Append.append('<div class="blog-header">' + item.text + '</div>'); console.log(item.text); } if( (typeof(item.attachments) !== 'undefined') && (item.attachments[0].type == 'photo') && (typeof(item.attachments[0].photo.photo_604) !== 'undefined') ) { item2Append.append('<div class="blog-header">' + item.text + '</div> <img class="blog-img" src="' + item.attachments[0].photo.photo_604 + '"><br><div class="blog-text">' + item.attachments[0].photo.text + '</div><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 + '&text=' + item.attachments[0].photo.text + '"><img src="share.png"></a></div>'); //console.log(item.attachments[0].photo.photo_604); } console.log('******************************\n'); if(item2Append.children().length != 0) { item2Append = item2Append.add('<br>'); placeHolder.append(item2Append); } }); }, error: function(error) { console.log('Ошибка'); console.log(error); } }); </script>