[英]On scroll load more data from database not working in IE 11
我试图在滚动到底部时加载更多数据。 在Edge,Chrome,Firefox中一切正常,但在IE 11中则无法正常工作。
这是我的代码:
$(window).scroll(function() {
if ($(document).height() <= $(this).scrollTop() + $(this).height()) {
if (timer) {
window.clearTimeout(timer);
}
timer = window.setTimeout(function() {
// Magic goes here
}, 400);
}
});
元标记设置为
<meta http-equiv="X-UA-Compatible" content="IE=edge">
多谢
编辑
如果我在IE上打开调试模式,则一切正常。 没有错误
刚刚在IE11上测试了您的代码示例,即可正常工作。 这是我在浏览器中运行的测试代码:
var timer;
$(window).scroll(function(){
if ($(document).height() <= $(this).scrollTop() + $(this).height()) {
if(timer) {
window.clearTimeout(timer);
}
timer = window.setTimeout(function() {
alert('bottom of page');
});
}
});
IE11的控制台上是否抛出任何错误? 共享更多有问题的代码会有所帮助,因为您给出的示例没有内在的原因无法在IE11上使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.