页面加载时同时加载多个函数:
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
}else {
window.onload = function() {
oldonload();
func();
}
}
}
页面加载时同时加载多个函数:
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
}else {
window.onload = function() {
oldonload();
func();
}
}
}
本文标题:共享onload事件函数
本文链接:https://www.haomeiwen.com/subject/ldcnjxtx.html
网友评论