delvinkrasniqi

custom js

Feb 5th, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. var page = 2;
  2. jQuery(function($) {
  3. $('body').on('click', '.loadmore', function() {
  4. var data = {
  5. 'action': 'load_posts_by_ajax',
  6. 'page': page,
  7. 'security': blog.security
  8. };
  9.  
  10. $.post(blog.ajaxurl, data, function(response) {
  11. if(response != '') {
  12. $('.rowtest').append(response);
  13. page++;
  14. } else {
  15. $('.loadmore').hide();
  16. }
  17. });
  18. });
  19. });
Add Comment
Please, Sign In to add comment