且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用户到达底部时如何加载新页面/URL

更新时间:2023-12-03 10:12:40

您可以根据鼠标窗口位置发送ajax调用.

You can send the ajax call based on mouse window position.

 var no=1;
    $(window).scroll(function () {
        if(no==1)
        {
            if ($(window).height() + $(window).scrollTop() == $(document).height()) {
                no=2;
                $.ajax({
                    type: "POST",
                    url: "about.html",
                    data: datas,
                    cache: false,
                    success: function(html){

                    }
                });
            }
        }
    });

此ajax调用将在用户到达页面末尾时调用.您可以指定它发生的高度.

This ajax call will call when a user reaches at end of page. You can specify a height at which it occurs.