Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(document).ready(function(){
- load_data();
- function load_data(page)
- {
- $.ajax({
- url:"pagination2.php",
- method:"GET",
- data:{page:page},
- success:function(data){
- $('#page').html(data);
- //alert('Successfully called');
- },
- //error:function(exception){alert('Exeption:'+exception);}
- })
- }
- //load_data(1);
- $(document).on('click', '.pagination_link', function(){
- var page = $(this).attr("id");
- load_data(page);
- });
- });
- </script>
- if($page_nb > 1) {
- //echo "<a href='index_all.php?page=".$prev_page."'>Back</a>";
- echo "<span class='pagination_link' style='cursor:pointer;' id='".$prev_page."'>Back</span>";
- }
- if ( $products_count > $check ) {
- for ( $i = max( 1, $page_nb - 5 ); $i <= min( $page_nb + 5, $limit ); $i++ ) {
- if ( $current_page == $i ) {
- echo "<span class="selected">{$i}</span>";
- } else {
- //echo "<a href="{$url}?page=" . $i . "">{$i}</a>";
- echo "<span class='pagination_link' style='cursor:pointer;' id='".$i."'>".$i."</span>";
- }
- }
- }
- if ($products_count > $check) {
- $next_page = $page_nb + 1;
- //echo "<a href='index_all.php?page=".$next_page."'>Next</a>";
- echo "<span class='pagination_link' style='cursor:pointer;' id='".$next_page."'>Next</span>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement