Prindol

DESIGN, HTML5, CSS3, DOM, Jquery, JSON, Actionscript2/3, Linux, IIS

You are not logged in.

#1 2014-06-19 12:49:02

skydown
Administrator
Registered: 2011-07-25
Posts: 317

[JAVASCRIPT] addLoadEvent() 중복 로드 처리

- IE7 이하 버전 호환

function addLoadEvent(func) {// 중복 로드 처리
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        if (document.all && !document.querySelector) {//IE7 or lower
            window.onload = func;
        } else {
            window.onload = func();
        }
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}
addLoadEvent(function() {
    //code
}

Offline

Board footer

Powered by FluxBB