function ttlist(page,pagesize,params,url,tbody,callback,pagediv,prepages_input,page_div) { params.page=page; params.pagesize=pagesize; jQuery.post(url, parmas, function(data, textStatus, xhr) { if(data==null) return; var items=data.items; var pages=data.pages; var tbobj=$(tbody); tbobj.empty(); if(callback!=null) { jQuery.each(items, function(index, val) { var str=callback(index,val); jQuery.append(str); }); } if(prepages_input!=null) { var prepages=prepages_input.val(); if(prepages!=pages) { prepages_input.val(pages); jQuery(pagediv).bootpag({total:pages,maxVisible:10,page:page+1}).on('page',function(event,num){ getlist(num-1,pagesize,params,url,tbody,callback,pagediv); }); } } if(page_div!=null) page_div.val(page); },'json'); }