list.php <meta charset="utf-8"/> <input type="text" id="sousuo"><input type="button" value="搜索" οnclick="check_ss();"> <div id="u_sousuo"> <div id="fenye"> <table border="1"> <th>序号</th> <th>名称</th> <th>状态</th> <th>操作</th> <?php while(@$arr=mysql_fetch_assoc($result)){ ?> <tr> <td><input type="checkbox" name="checkbox" id="<?php echo $arr['id']?>"><?php echo $arr['id']?></td> <td><?php echo $arr['name']?></td> <td><a href="javascript:void(0);" οnclick="check_sd(this,<?php echo $arr['id']?>);"><?php echo $arr['state']?"锁定":"未锁定";?></a></td> <td><a href="javascript:void(0);" οnclick="check_sc(this,<?php echo $arr['id']?>);">删除</a> </td> </tr> <?php } ?> <tr> <td colspan="7" align="center"> <input type="checkbox" id="quan" οnclick="check_quan();">全选/全不选 <input type="button" id="fan" οnclick="check_fan();" value="反选"> <input type="button" id="pl" οnclick="check_pl();" value="批量删除"> <a href="javascript:void(0);" οnclick="check_fenye(1);">首页</a> <a href="javascript:void(0);" οnclick="check_fenye(<?php echo $page+1?>);">下一页</a> <a href="javascript:void(0);" οnclick="check_fenye(<?php echo $page-1?>);">上一页</a> <a href="javascript:void(0);" οnclick="check_fenye(<?php echo $page=$page_count?>);">尾页</a> </td> </tr> </table> </div> </div> <Script>//搜索后分页 此事件为搜索后给上一页下一页的事件 function check_ssfy(page){ //alert(page);return false; var sousuo=document.getElementById('sousuo').value; //alert(sousuo);return false; var ajax=new XMLHttpRequest(); ajax.onreadystatechange=function(){ if(ajax.readyState==4 && ajax.status==200){ //alert(ajax.responseText);return false; document.getElementById('u_sousuo').innerHTML=ajax.responseText; } } ajax.open('get','exam_ss.php?page='+page+'&sousuo='+sousuo,true); ajax.send(null); }</script>
搜索要替换的页面 ss.php<table border="1"> <th>序号</th> <th>名称</th> <th>状态</th> <th>操作</th> <?php while(@$arr=mysql_fetch_assoc($result)){ ?> <tr> <td><input type="checkbox" name="checkbox" id="<?php echo $arr['id']?>"><?php echo $arr['id']?></td> <td><?php echo $arr['name']?></td> <td><a href="javascript:void(0);" οnclick="check_sd();">未锁定</a></td> <td><a href="javascript:void(0);" οnclick="check_sc(this,<?php echo $arr['id']?>);">删除</a> </td> </tr> <?php } ?> <tr> <td colspan="7" align="center"> <input type="checkbox" id="quan" οnclick="check_quan();">全选/全不选 <input type="button" id="fan" οnclick="check_fan();" value="反选"> <input type="button" id="pl" οnclick="check_pl();" value="批量删除"> <a href="javascript:void(0);" οnclick="check_ssfy(1);">首页</a> <a href="javascript:void(0);" οnclick="check_ssfy(<?php echo $page+1?>);">下一页</a> <a href="javascript:void(0);" οnclick="check_ssfy(<?php echo $page-1?>);">上一页</a> <a href="javascript:void(0);" οnclick="check_ssfy(<?php echo $page=$page_count?>);">尾页</a> </td> </tr> </table>
搜索后分页
最新推荐文章于 2021-03-28 14:38:52 发布