点击这里给我发消息 点击这里给我发消息
首页 > 行业资讯 > HTML>详细内容

html无刷新分页前端代码

添加时间:2013-12-6
    相关阅读: 相关内容

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../Script/jquery-1.8.3.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $.post("Test.ashx", { "action": "getpagecount" }, function (data, status) {
                for (var i = 1; i <= data; i++) {
                    var td = $("<td><a href=''>" + i + "</a></td>");
                    $("#trpage").append(td);
                }

           $("#trpage td").click(function (e) {

            e.preventDefault();

           $.post("Test.ashx", { "action": "getpagedata", "pagenum": $(this).text() },
             function (data, status)
           {
            var comments = $.parseJSON(data);

             $("#ulorderlist").empty();

             for (var i = 0; i < comments.length; i++) {
             var comment = comments[i];
             var li = $("<li>" + comment.OrderID + "--" + comment.OrderDate + "</li>");
                            $("#ulorderlist").append(li);
                        }

                    });

                })
            });


        });
    </script>
</head>
<body>
    <ul id="ulorderlist">
    </ul>
    <table>
        <tr id="trpage">
        </tr>
    </table>
</body>
</html>

 

咨询热线:020-85648757 85648755 85648616 0755-27912581 客服:020-85648756 0755-27912581 业务传真:020-32579052
广州市网景网络科技有限公司 Copyright◎2003-2008 Veelink.com. All Rights Reserved.
广州商务地址:广东省广州市黄埔大道中203号(海景园区)海景花园C栋501室
= 深圳商务地址:深圳市宝源路华丰宝源大厦606
研发中心:广东广州市天河软件园海景园区 粤ICP备05103322号 工商注册