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

90
Views
La paginación de Ajax no recuerda la página anterior

Hice una paginación ajax y, por ejemplo, si voy a la página 4 y entro en una publicación y quiero volver, vuelve a la página 1.

pero debería volver a la página 4 porque eso es lo que tiene sentido. no encuentro como hacer esto

aquí están mis códigos;

índice.php;

 <div id="discountVilla"> <h1>Luxury Villa</h1> <div id="results"> </div> <div id="loader"></div> <div class="clearfix"></div> </div> <script type="text/javascript"> function showRecords(perPageCount, pageNumber) { $.ajax({ type: "GET", url: "ajax.php", data: "pageNumber=" + pageNumber, cache: false, success: function(html) { $("#results").html(html); $('#loader').html(''); } }); } $(document).ready(function() { showRecords(10, 1); }); </script>

Y Ajax.php

 <div class="col-lg-12"> <ul class="pagesclass"> <?php for ($i = 1; $i <= $pagesCount; $i++) { if ($i == $pageNumber) { ?> <li><a href="javascript:void(0);" class="current" style="background-color: #5a5b90;"> <?php echo $i ?> </a></li> <?php } else { ?> <li><a href="javascript:void(0);" class="pages" onclick="showRecords('<?php echo $perPageCount; ?>', '<?php echo $i; ?>');"> <?php echo $i ?> </a></li> <?php } // endIf } // endFor ?> </ul> <script> $(".pages").click(function() { $('html, body').animate({ scrollTop: $("#discountLuxury").offset().top }, 'slow'); }); </script> </div>

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!