Mootools add window onload event

来源:互联网 发布:linux网络编程视频 编辑:程序博客网 时间:2024/06/07 12:52

In IE7, the following code will not do if the html page has little content

window.addEvent("domready", function() {
    $(window).addEvents( {
        "load" : loadListener
    });
    function loadListener() {
        window.alert("Window has loaded!");
    }
});

And these code shoud be changed like this:

window.addEvents( {
    "load" : function() {
        window.alert("Window has loaded!");
    },
    "domready" : function() {
        /* do something */
    }
});

原创粉丝点击