jquery-ias not loading anything

1.2k Views Asked by At

I am using jquery-ias.min.js for producing an infinite scrol in my page but the plugin is not displaying anything.. Just the message that "there are no more pages left to load"? i am using this code.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="/_layout/js/jquery-ias.min.js"></script>
<script type="text/javascript">
    var ias = $.ias({
        container: "#posts",
        item: ".post",
        pagination: "#pagination",
        next: ".next a"
    });
    ias.extension(new IASSpinnerExtension());
    ias.extension(new IASTriggerExtension({
        offset: 2
    }));
    ias.extension(new IASNoneLeftExtension({
        text: 'There are no more pages left to load.'
    }));
</script>
1

There are 1 best solutions below

8
On

The response there are no more pages left to load means the next page doesn't exists.
Check if your next selector (.next a) is correct, maybe it is not getting the link. If the selector is correct, check your server response for the next page.

Update
Your html:

<div id="pagination"> 
    <a class="" href="/highlights-1" >2</a> 
    <a class="next" href="/page2.html" >1</a> 
</div>

Your selector to get the next link is invalid, if you try $('.next a') the result will be an empty array. The correct is just .next.
Change your initialization to:

var ias = $.ias({
    ...
    next: ".next"
});