index.js 906 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. $(function(){
  2. $("#first").click(function(){
  3. var currentPage = $("#currentPage").text();
  4. if(currentPage == "1"){
  5. return false;
  6. }
  7. window.location.href = "get?page=1";
  8. });
  9. $("#previous").click(function(){
  10. var currentPage = $("#currentPage").text();
  11. if(currentPage == "1"){
  12. return false;
  13. }
  14. currentPage = parseInt(currentPage);
  15. currentPage--;
  16. window.location.href = "get?page="+currentPage;
  17. });
  18. $("#next").click(function(){
  19. var currentPage = $("#currentPage").text();
  20. var pages = $("#pages").text();
  21. if(currentPage == pages){
  22. return false;
  23. }
  24. currentPage = parseInt(currentPage);
  25. currentPage++;
  26. window.location.href = "get?page="+currentPage;
  27. });
  28. $("#last").click(function(){
  29. var currentPage = $("#currentPage").text();
  30. var pages = $("#pages").text();
  31. if(currentPage == pages){
  32. return false;
  33. }
  34. window.location.href = "get?page="+pages;
  35. });
  36. })