Created
May 30, 2019 13:47
-
-
Save ronipl/1b7b644b57fcc0c72b61dee4ebd7efce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadmoreByButton(){ | |
//var moreButon = $('#more').last(); | |
var nextUrl = $('.more').attr("link"); | |
$('body').on('click', '.more', function(){ | |
$.ajax({ | |
url: nextUrl, | |
type: 'GET', | |
beforeSend: function() { | |
$('.more').remove(); | |
} | |
}) | |
.done(function(data) { | |
console.log($(data).find('#collection-product-items').html()); | |
$('#collection-product-items').append($(data).find('#collection-product-items').html()); | |
nextUrl = $(data).find('#more').attr("link") | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment