简体   繁体   English

滚动加载时,来自数据库的更多数据无法在IE 11中运行

[英]On scroll load more data from database not working in IE 11

I trie to load more data on scroll to the bottom. 我试图在滚动到底部时加载更多数据。 All works fine in Edge,Chrome,Firefox but not in IE 11. Nothing happens there 在Edge,Chrome,Firefox中一切正常,但在IE 11中则无法正常工作。

Here's my Code: 这是我的代码:

$(window).scroll(function() {
    if ($(document).height() <= $(this).scrollTop() + $(this).height()) {
        if (timer) {
            window.clearTimeout(timer);
        }
        timer = window.setTimeout(function() {
            // Magic goes here
        }, 400);
    }
});

Meta Tag is set to 元标记设置为

<meta http-equiv="X-UA-Compatible" content="IE=edge">

Many thx 多谢

EDIT 编辑

If i open the debug mode on IE , everything works fine. 如果我在IE上打开调试模式,则一切正常。 No errors 没有错误

Just tested your code example on IE11 and works perfectly fine. 刚刚在IE11上测试了您的代码示例,即可正常工作。 Here is the test code i ran in the browser: 这是我在浏览器中运行的测试代码:

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');
         });
     }
});

Are there any errors thrown in your console on IE11? IE11的控制台上是否抛出任何错误? Sharing more of the code in question would help, as there is no inherent reason for the example you have given to not work on IE11. 共享更多有问题的代码会有所帮助,因为您给出的示例没有内在的原因无法在IE11上使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM