Advertisement
Guest User

Untitled

a guest
May 12th, 2016
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. contentButton.click(function() {
  2.  
  3.        
  4.     var contentPlacement = document.querySelector('#content-container').lastChild.previousElementSibling.previousElementSibling;
  5.     var kategorija = contentButton.data-category;
  6.     var puslapis   = $('#search-trigger').children().length;
  7.  
  8.     $.get('../php/load-more-category.php', {psl: puslapis, category: kategorija }, function(info) {
  9.          $.each($.parseJSON(info), function(index, value) {
  10.   contentPlacement.insertAfter(
  11. " <div class='col-md-12 top' style='padding: 0;''>" +
  12.             " <div class='message'> " +
  13.       "  <div class='upper-message'> " +
  14.           "  <span class='author'>" + value['autorius'] + "</span>" +
  15.            " <span class='date'>" + value['data'] +"</span>" +
  16.            " <span class='cat'>" + value['category'] + "</span> " +      
  17.        " <div class='main-part'> " +            
  18.           nl2br(value['main_info']) +
  19.       "  </div>  " +
  20.  
  21.        " <div class='rating-part'> " +
  22.           "  <a href='javascript:;' class='upvote-button' onclick='upvoteButtonHandler(this);'> " +
  23.            " <span class='upvote-word'>Patinka</span> " +
  24.            " <span class='upvote-number'>" + value['upvotes'] + "</span> " +
  25.            " <span class='upvote-id'>" + value['id'] + "</span> " +
  26.  
  27.  
  28. "</a>"  +
  29.        " </div> ");
  30.   });
  31. });
  32.  
  33.    });
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement