基于jquery鼠标或者移动端滚动加载数据
1 var stop = true; // 防止重复请求数据 2 $(window).scroll(function () { 3 totalheight = parseInt($(window).height()) + parseInt($(window).scrollTop()); 4 if ($(document).height() <= totalheight) { 5 if (stop == true) { 6 stop = false; 7 $.post("loadContent1.html", function (data) { 8 stop = true; 9 }, "html"); 10 } 11 } 12 });