简体   繁体   中英

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

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. No errors

Just tested your code example on IE11 and works perfectly fine. 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? 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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