remove/add pagination buttons

I have a blog.Few articles inside.Per each article I have a lot of comments that I decide to paginate in group of 5 (let's say..if i have 15 comments i have 3 pagination buttons). I did this by a method of my comment_manager class on pageLoad.

public function pagination($in_art,$perPage)
    $pages = ceil($count/$per_page);

    echo"<div class='pagination'>";
         for($i=1; $i<=$pages; $i++)
            echo "<div class='pag' id='pag_{$i}'>$i</div>";

everything is fine. This is how I handle my buttons through JQuery

  [...]//code missing for sake of brevity

  $('#pag_1').css({'color' : '#FF0084'}).css({'border' : 'none'});

  //Pagination Click

  //CSS Styles
  .css({'border' : 'solid #dddddd 1px'})
  .css({'color' : '#0063DC'});

 .css({'color' : '#FF0084'})
 .css({'border' : 'none'});

 //Loading Data
 var data="page="+pageNum+"&id_art="+idArt;
        type: "POST",  
        url: "php/pagination_data.php",  
        data: data,  
        cache: false,  
        success: function(html){  


The point is I need to refresh my pagination buttons after deleting or adding new comments on the fly (dont want the whole page to refresh!).So remove them or add new ones if needed(for example with 16 comments i need one more button) Thanks Luca


Seems to me that if you want the actual pagination links to be updated on the fly, then you will need to create an AJAX version that returns the current pagination.

For example: When you delete a comment, after the comment gets deleted, run an AJAX call to get what the pagination is now, and update the pagination div's contents.

Need Your Help

Missing keyword error in Oracle

sql oracle alter-table

I am trying to alter a column data type in SQL but it gives me missing keyword error. I have looked at how to change a column in several places and they all gave me this piece of query:

Does Hive support Select in Select?

sql hadoop hql hive

Is the code bellow in Hive possible, wich some change?:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.