Answer the question
In order to leave comments, you need to log in
How to get data on click through AJAX SMARTY template engine?
Using Smarty, 6 blocks will initially be loaded, with names, ages, etc.
At the bottom there is a button "Show more"
How to make it so that when you click on the button to show more, 6 more elements are loaded using AJAX?
Answer the question
In order to leave comments, you need to log in
function getNextSixItems() {
$.ajax({
type: 'POST',
url: "/url/to/some/action/",
dataType: 'json',
success: function (data) {
here your code/
}
});
};
$(document).on('click', '.showMore', function (e) {
e.preventDefault();
getNextSixItems();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question