Jquery callback function executes over and over again...

Posted by Pandiya Chendur on Stack Overflow See other posts from Stack Overflow or by Pandiya Chendur
Published on 2010-04-01T06:18:33Z Indexed on 2010/04/01 6:23 UTC
Read the original article Hit count: 349

Filed under:
|
|

This my jquery function,

function getRecordspage(curPage, pagSize) {
   // code here
$(".pager").pagination(strarr[1], { callback: 
         function() { getRecordspage(2, 5);},current_page: curPage - 1, 
          items_per_page:'5',  num_display_entries: '5', next_text: 'Next', 
           prev_text: 'Prev', num_edge_entries: '1'
      });

}

and i call this jquery function,

<script type="text/javascript">
         $(document).ready(function() {
             getRecordspage(1, 5);
         });

</script>

As you see my It works fine for 1st time and my callback function is configured to the current function itself... when it gets called the callback gets executed over and over again.... How can i prevent this? Any suggestion....

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about callback