注册 登录
编程论坛 JavaScript论坛

请问怎么接收分页 page 的函数?

jianruiqun 发布于 2014-11-14 20:12, 638 次点击
<script type="text/javascript">
$('body').on('click','.post-main',function () {
    if (this.getAttribute ('data-type') != 'audio') {
        location.href=this.getAttribute ('data-url');
    }
});



$('.pages').hover(function () {
    $('.pages ul').stop().show('fast');
},function () {
    $('.pages ul').stop().hide('fast');
});




    var totalPages = 3;

    var pageSize = 10;

    var postOffset = pageSize;
    if (totalPages) {
        $('#load-more').click(function () {
            if ((postOffset/pageSize) >= totalPages) {
                this.className = 'nopages';
                this.innerHTML='The End';
                $(this).unbind('click');
                return false;
            }
            var _this = this;

            _this.className = 'loading';

            var url = 'Ajax_getpiclist.asp';
            $.get(url, {
                _posts: {
                    limit: pageSize,
                    offset: postOffset
                }
            }, function(data) {
                postOffset+=pageSize;
                $('#main').append(data);
                _this.className = 'icon load-more';

                if ((postOffset/pageSize) >= totalPages) {
                    _this.className = 'nopages';
                    _this.innerHTML='The End';
                    $(_this).unbind('click');
                }
            });
        })
    }

</script>

请问怎么在 Ajax_getpiclist.asp 页面接收分页page的函数?
4 回复
#2
jianruiqun2014-11-14 20:16
http://wrrchaoshengzhe. 就是这样的效果。。。
#3
tlliqi2014-11-14 20:32
看看什么样的效果
#4
jianruiqun2014-11-14 20:32
现在效果是有了,就是不能分页,每次点击就是那么几个记录。
Ajax_getpiclist.asp里的代码:

<!--#include file="Conn.asp" -->
<%

page=Request("page")
set rs=server.CreateObject("adodb.recordset")
sql="select * from news where newscount=0 order   by  id  desc"
rs.open sql,conn,1,1
    If not rs.EOF Then
        iPageSize=5
        rs.PageSize = iPageSize
        iCount = rs.RecordCount
        maxpage = rs.PageCount
        If page<1 Then
            page = 1
        ElseIf page>maxpage Then
            page = maxpage
        End If
        rs.AbsolutePage = page
        If page = maxpage Then
            x = iCount - (maxpage -1) * iPageSize
        Else
            x = iPageSize
        End If
        For i=0 To x-1

%>
1
<%
Rs.MoveNext
Next
End If
rs.close
Set rs = nothing
CloseConn()
%>
page=Request("page") 这里怎么接收?老大

[ 本帖最后由 jianruiqun 于 2014-11-14 20:35 编辑 ]
#5
jianruiqun2014-11-17 15:20
没有人吗。。。。
1