Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

343
Views
pagination.js is not working properly in my javascript project

I want to use the jquery pagination plugin from pagination.js.org. I used the following code to include this plugin.

    <script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/paginationjs/2.0.7/pagination.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/5.5.2/bootbox.min.js"></script>

And this is the HTML code.

<div class="container">
    <div class="row">
        <div class="data-container"></div>
        <div class="pagination-container"></div>
    </div>
</div>

Then I created pagination in another javascript file.

function template(data) {
    let html = '<ul>';
    $.each(data, function(index, item){
        html += '<li>'+ item +'</li>';
    });
    html += '</ul>';
    return html;
}

$(document).ready(function() {
    $('.pagination-container').pagination({
        dataSource: [1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 100],
        callback: function(data, pagination) {
      // template method of yourself
      let html = template(data);
      $('.data-container').html(html);
    }
  });
});

But javascript error occurred when execution.

teachers.js:11 Uncaught TypeError: $(...).pagination is not a function
    at HTMLDocument.<anonymous> (teachers.js:11)
    at i (jquery-2.2.4.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-2.2.4.min.js:2)
    at Function.ready (jquery-2.2.4.min.js:2)
    at HTMLDocument.J (jquery-2.2.4.min.js:2)

It acts like the library was not loaded properly but I cannot figure it out.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!