日期:2014-05-18 浏览次数:20400 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>无标题页</title> <script language="JavaScript" src="jquery_last.js" type="text/javascript"></script> <script language="JavaScript" src="jquery.pagination.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> $(document).ready(function() { InitData(0); }); //这个事件是在翻页时候用的 function pageselectCallback(page_id) { InitData(page_id); } function InitData(pageIndex) { var tbody = ""; var totalNum; $.ajax({ type: "POST", dataType: "xml", url: 'Handler.ashx', data: "pageIndex=" + (pageIndex + 1) + "", success: function(xml) { $("div").remove(".userBox"); $(xml).find("Page").each(function() { totalNum = $(this).attr("RecCount"); }); $(xml).find("item").each(function() { num_entries = $(xml).find("item").size(); var userID = $(this).attr("ID"); var userName = $(this).attr("UserName"); var address = $(this).attr("Address"); var sex = $(this).attr("Sex"); var phone = $(this).attr("Phone"); var email = $(this).attr("Email"); var html = "<div class=\"userBox\" style=\"width:650px; height:30px;\"><ul style=\"margin:0;padding:0;list-style:none;\">"; html +="<li style=\"width:100px;float:left; \">"+userID+"</li>"; html +="<li style=\"width:100px;float:left; \">"+userName+"</li>"; html +="<li style=\"width:100px;float:left; \">"+sex+"</li>"; html +="<li style=\"width:100px;float:left; \">"+phone+"</li>"; html +="<li style=\"width:100px;float:left; \">"+email+"</li>"; html +="<li style=\"width:100px;float:left; \">"+address+"</li></ul>"; html +="</div><div style=\"clear: both;\"></div>"; tbody += html; }); $("#userlist").append(tbody); initPagination(totalNum,pageIndex); } }); } function initPagination(TotalNum,pageIndex) { $("#Pagination").pagination(TotalNum, { p