Jquery callback function executes over and over again...
- by Pandiya Chendur
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....