window.onload绑定多个函数
1 function addLoadEvent(fun) { 2 var oldonload = window.onload; 3 if (typeof window.onload != 'funcation') { 4 window.onload = fun; 5 } 6 else { 7 window.onload = function () { 8 oldonload(); 9 fun(); 10 } 11 } 12 }
1 function addLoadEvent(fun) { 2 var oldonload = window.onload; 3 if (typeof window.onload != 'funcation') { 4 window.onload = fun; 5 } 6 else { 7 window.onload = function () { 8 oldonload(); 9 fun(); 10 } 11 } 12 }