开发者

Paging with jQuery

开发者 https://www.devze.com 2022-12-22 11:00 出处:网络
I am trying to take data to one page from another. The problem is here is, data may be too long and divided into multiple pages. When the user clicks on 1, 2, 3, ... links he is redirected to the othe

I am trying to take data to one page from another. The problem is here is, data may be too long and divided into multiple pages. When the user clicks on 1, 2, 3, ... links he is redirected to the other page. However, I want data to be reloaded on the same page. With SLaks's suggestions I came up with the following code but it is not working at the moment.

$('ul.thumbs li.pagination a').live('click', function() { var pageNumber = parseInt($(this).text().replace(/[^0-9]/g, ''));

$(function ViewImages() {
    $.ajax({
        type: "GET",
        url: "images.cs.asp?Process=ViewImages&PAGEID=" + pageNumber,
        success: function(data) {
            $("#ViewImages").htm开发者_如何学Gol(data);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            $("#ViewImages").html('.');
        }
    });
});

return false;

});


You can use jQuery to intercept the links, like this:

$('ul.thumbs li.pagination a').live('click', function() { 
    var pageNumber = parseInt($(this).text().replace(/[^0-9]/g, ''));
    //Load page
    return false;
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号