How do you get the tapes out of several Wontact groups?



  • There's a code that turns the posts out of the band into the "canwerPlaceHolder block, so if I'm also going to take out the posts and the other band, it's just another block of "betaFeed" how to realize that they're not in the way of 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 = $('&lt;div class= "blog-post"&gt;&lt;/div&gt;');          
    
            if((item.text != 'undefined') &amp;&amp; (item.text != ''))
            {             
             // item2Append.append('&lt;div class="blog-header"&gt;' + item.text + '&lt;/div&gt;');
              console.log(item.text);
            }
    
            if(                
                (typeof(item.attachments) !== 'undefined') &amp;&amp;
                (item.attachments[0].type == 'photo') &amp;&amp; 
                (typeof(item.attachments[0].photo.photo_604) !== 'undefined')
              )
            {              
              item2Append.append('&lt;div class="blog-header"&gt;' + item.text + '&lt;/div&gt; &lt;img class="blog-img" src="' + item.attachments[0].photo.photo_604 + '"&gt;&lt;br&gt;&lt;div class="blog-text"&gt;' + item.attachments[0].photo.text + '&lt;/div&gt;&lt;div class="blog-share"&gt;&lt;a href="http://gamer-by-life.com/share/?title='+ item.text +  '&amp;img='+ item.attachments[0].photo.photo_604 + '&amp;time='+item.date + '&amp;text=' + item.attachments[0].photo.text + '"&gt;&lt;img src="share.png"&gt;&lt;/a&gt;&lt;/div&gt;');
              //console.log(item.attachments[0].photo.photo_604); 
            }
    
            console.log('******************************\n');
            if(item2Append.children().length != 0)
            {
              item2Append = item2Append.add('&lt;br&gt;');
              placeHolder.append(item2Append);   
            }
    
          });                 
        },
        error: function(error)
        {
          console.log('Ошибка');
            console.log(error);
        }
    

    });
    </script>



  • I may suggest, for example, that:

    $(function() {
    

    var placeHolder = $('#answerPlaceHolder');
    getVKposts(-41633702);
    getVKposts(-22822305);

    function getVKposts(groupID) {
    var url = 'https://api.vk.com/method/wall.get?owner_id=' + groupID + '&count=3&filter=all&v=5.45';
    var answer;
    var d = $.ajax({
    url: url,
    type: 'get',
    crossDomain: true,
    dataType: 'jsonp',
    success: function(response) {
    var answer;
    answer = response;
    answer.response.items.forEach(function(item) {
    var item2Append = $('<div class= "blog-post"></div>');
    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>');
    }
    placeHolder.append(item2Append);
    });
    },
    error: function(error) {
    console.log('Ошибка');
    }
    });
    }
    });

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <div id="answerPlaceHolder"></div>
    <div id="betaFeed"></div>




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2