Easy ajax pagination

Submitted by riddles8888 - 3 years ago

Use laravel pagination with this small bit of jquery to ajax load paginated results. Create a page with the data you wish to paginate. http://www.example.com/paginated/data

<div id="ajaxContent">


$('.pagination a').on('click', function (event) {
    if ( $(this).attr('href') != '#' ) {
        $("html, body").animate({ scrollTop: 0 }, "fast");
comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks