[英]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.