0

When the page loads I can easily click "Next" and goes to page 2.

But then when I click "Back" nothing happens.

<script>
  $("#pagination li").click(function() {
    $("#Div").load("https://www.xxx.php?pageno=" + this.id + " #Div")
    $(window).scrollTop( $("#Div").offset().top );
  });
</script>
<ul id="pagination">
  echo '<li id=1><a href="javascript:void(0);">Back</a></li>';
  echo '<li id=2><a href="javascript:void(0);">Next</a></li>';
</ul>

Clicking "Back" should send me to page 1.

Shadow
  • 33,525
  • 10
  • 51
  • 64
Blind
  • 1
  • 2
  • I had a similar question once to which I later found a working answer myself – it might help you: https://stackoverflow.com/questions/37243810/triggering-an-onload-script-js-or-jquery-when-loading-the-page-via-the-browser – Johannes Mar 20 '23 at 17:11

0 Answers0