callback: pageselectCallback, //点击分页时,调用的回调函数
prev_text: '<上一页', //显示上一页按钮的文本
next_text: '下一页>', //显示下一页按钮的文本
items_per_page:10, //每页显示的项数
num_display_entries:6, //分页插件中间显示的按钮数目
current_page:page_id, //当前页索引
num_edge_entries:2 //分页插件左右两边显示的按钮数目
});
}
}
//点击分页时调用的函数,page_id为当前页的索引
function pageselectCallback(pageIndex)
{
var temp="";
var total=0;
var q = $("#isearch").val();
var t = $("#type").val();;
var p = pageIndex+1;
// var p = pageIndex;
$.ajax({
async:false,
dataType: "json",
type: "post",
url: "http://10.18.224.102/edusearch/search/search",
data: {
"q":q,
"t":t,
"n":10,
"p":p
},
//发送请求前,显示加载动画
beforeSend:function(){$("#divload").show();$("#datas #Pagination").hide()},
//请求完毕后,隐藏加载动画
complete:function(){$("#divload").hide();$("#datas #Pagination").show()},
success: function(data,textStatus,jqXHR) {
// alert(data);
if(data!=null&&data!=""){
var obj = eval(data);
if(obj.retCode==0){
var items = obj.items;
// for(var i=0;i<items.length;i++){
// if(items[i]!=null){
// alert(items[i].name);
// }
// }
var json=items;//json数据
total=obj.total;//记录总数
if(json==null||json==undefined){
$("#datas").html("");
}
else{
$.each(json,function(index,item){
// temp+="<div id='datas' classdivclass="d_out" onmouseover="this.className='d_over'" "+
//"onmouseout="this.className='d_out'" style='padding: 10px 15px 12px 15px;'>"+
//"<strong> <a style='font-size: 20px;font-famliy: 宋体;color:#333;' href='"+item.user_id+"' target='_blank'>"+
// item.user_name+"</a></strong>"+
// "<div style='font-size: 12px; font-famliy: 宋体; '>"+"part_id:"+item.part_id+" </div>"+
// "<div style='font-size: 14px; font-famliy: 宋体; text-indent: 2em; margin-top: 5px;'>"+
// "user_id:"+item.user_id+" </div></div><hr />";
temp+=arrayToJson(item)+"<hr />";
});
$("#datas").html(temp); //将创建的新行附加在DIV中
}
}
}
},
error : function() {
alert("搜索失败!");
}
});
return total;
}
function pageClick(pageIndex, total, spanInterval){
var total = pageselectCallback(pageIndex);
if(total!=0){
var intPageIndex = parseInt(pageIndex);
//创建分页
//将总记录数结果 得到 总页码数
var pageS = total;










