Search code examples
javascriptjquerypaginationjquery-pagination

Pagination with JavaScript


I have html code that have some <div class="post"> inside. I want to paginate them with javascript. How can I do that? (I know I can do it by PHP but I just want to do it with JS)

the html generated by my php looks like that:

    <body>
<div id="content">
<div class="post">
post content
</div>
<div class="post">
</div>
...

</div>

</body>

Maybe it will be the best to use jquery for that? (I'm using jquery ajax to load html into content allready)


Solution

  • yea there is a jquery plugin that works nicely https://github.com/gbirke/jquery_pagination