ajax实现跳页删除

前端之家收集整理的这篇文章主要介绍了ajax实现跳页删除前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

只贴js代码HTML代码

js代码

$(document).ready(function() {
$.getJSON("RuserAction",function(data) {
$.each(data,function(z,item) {
$("#mes").append(
"<tr class='con'><td height='20' class='STYLE19'>"
+"<div align='center'>"
+"<span class='STYLE19'> "
+item.id
+"</span>"
+"</div>"
+"</td>"
+"<td class='STYLE19' height='20'>"
+"<div align='center'>"
+item.name
+"</div>"
+"</td>"
+"<td class='STYLE19' height='20'>"
+"<div align='center'>"
+item.zhu
+"</div>"
+"</td>"
+"<td class='STYLE19' height='20'>"
+"<div align='center'>"
+"<a href='#' onclick='return conn(this);'> <div style='display:none;'>"
+item.id
+"</div><img src='images/del.gif'width='10' height='10' title='删除' /></a>"
+"</div>"
+"</td>"
+"</tr>" );
});
$("#mes").append(
"<tr style='background-color:white;' class='con'><td height='50' colspan='5' align='right'>总共<b><font size='4'>"+data[0].total+"</b></font>页"
+"<input type='text' size='3' width='5px' onblur='ut(this.value);' title='输入页数点击空白处'/>"
+"</td>"
+"</tr>");
$(".jt tr:odd").css("background-color","#E4F3FB");// 1,3 行
});
});

function ut(o) {
if($(".con").html()!=""){
$(".con").hide();
}
$.getJSON("RuserAction",{page:o},item) {
$("#mes").append(
"<tr class='con'><td height='20' class='STYLE19'>"
+"<div align='center'>"
+"<span class='STYLE19'> "
+item.id
+"</span>"
+"</div>"
+"</td>"
+"<td class='STYLE19' height='20'>"
+"<div align='center'>"
+item.name
+"</div>"
+"</td>"
+"<td class='STYLE19' height='20'>"
+"<div align='center'>"
+item.zhu
+"</div>"
+"</td>"
+"<td class='STYLE19' height='20'>"
+"<div align='center'>"
+"<a href='#' onclick='return conn(this);'> <div style='display:none;'>"
+item.id
+"</div><img src='images/del.gif'width='10' height='10' title='删除' /></a>"
+"</div>"
+"</td>"
+"</tr>" );
});
$("#mes").append(
"<tr class='con'><td height='50' colspan='5' align='right'>总共<b><font size='4'>"+data[0].total+"</b></font>页"
+"<input type='text' size='3' width='5px' onblur='ut(this.value);' title='输入页数点击空白处'/>"
+"</td>"
+"</tr>");
$(".jt tr:odd").css("background-color",3 行
});
}

HTML代码

<td width="45%" height="100%" style="vertical-align: top; "> <table width="97%" cellpadding="0" cellspacing="1" border="0" bgcolor=white style="filter:progid:DXImageTransform.Microsoft.Shadow (Color=#666666,Direction=120,strength=15);margin-right: 20px;" class="jt"> <tr id="mes"> <td bgcolor="d3eaef" class="STYLE6" > <div align="center"> <span class="STYLE10">IT用户</span> </div> </td> <td bgcolor="d3eaef" class="STYLE6" > <div align="center"> <span class="STYLE10">帐号名</span> </div> </td> <td bgcolor="d3eaef" class="STYLE6" > <div align="center"> <span class="STYLE10">主管权限</span> </div> </td> <td bgcolor="d3eaef" class="STYLE6"> <div align="center"> <span class="STYLE10">操作</span> </div> </td> </tr> </table> </td>

原文链接:https://www.f2er.com/ajax/166337.html

猜你在找的Ajax相关文章