Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).on("click", ".ajax-load-more", function(e) {
  2.     var container = $(this).parent();
  3.     var section = $(this).closest("section");
  4.     if (e.which === 1 && !e.ctrlKey && !e.shiftKey) {
  5.       e.preventDefault();
  6.       var url = $(this).attr("href");
  7.       $(this).replaceWith(spinner);
  8.       $.ajax(url, {
  9.         data: {"ajax": 1},
  10.         success: function(data) {
  11.           container.remove();
  12.           loadData(url, data, section);
  13.         },
  14.         error: function() {
  15.           location.href = url;
  16.         }
  17.       });
  18.     }
  19.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement