$(window).load() in IE?

前端 未结 3 1250
傲寒
傲寒 2020-12-18 13:48

Recently I ran into a mysterious problem that IE (6-8) is keeping throwing me an error. I don\'t know if this is the problem, but I think it is.

Open up the F12 deve

3条回答
  •  执笔经年
    2020-12-18 14:29

    I recently found a work-around for IE not recognizing $(window).load()...

    window.onload = function() {
        alert("See me, hear me, touch me!");
    };
    

    This is a little different than $(function(){}) as it executes after all elements are loaded as opposed to when the DOM is ready.

    I recently implemented this in another project and it worked wonderfully.

提交回复
热议问题