比较好用的ajax分页插件+jsonp跨域实现

比较好用的ajax分页插件+jsonp跨域实现

demo:

$.ajax({
            type: "get",
            url: "url",
            dataType: 'jsonp',
            data:{param: param, param2: param2},
            success: function(json) {
                if (json.code == 1) {
                    var data = json.data;
                    var str = '';
                    for (var i = 0; i <= data.length - 1; i++) {

                    }
                    $('#id').jqPaginator({
                        totalPages: json.pageCount,
                        visiblePages: 8,
                        currentPage: json.page,
                        first: '<a href="javascript:;">首页</a>',
                        prev: '<a href="javascript:;" class="offcn_prev">上一页</a>',
                        next: '<a href="javascript:;" class="offcn_next">下一页</a>',
                        page: '<a href="javascript:;">{{page}}</a>',
                        last: '<a href="javascript:;">末页</a>',
                        activeClass: 'beRed',
                        onPageChange: function (num, type) {
                            page = num;
                            if (type == 'change') {
                                searchPhone();
                            }
                        }
                    });
                }
            }
        });
Posted in