标签:type 加载 方案 class win 多个 onload lis eof
window.onload
function func() {
}
window.onload = func;
function func1() {
//...
}
function func2() {
//...
}
window.onload = function() {
func1();
func2();
}
addLoadEvent
,它是由Simon Willison编写的。
function addLoadEvent (func) {
let oldonload = window.onload;
if(typeof oldonload != ‘function‘) {
window.onload = func;
}else {
window.onload = function() {
oldonload();
func();
}
}
}
标签:type 加载 方案 class win 多个 onload lis eof
原文地址:https://www.cnblogs.com/BearBird/p/12859378.html