function addLoadEvent(func){
var oldonload=window.onload;
if(typeof window.onload!='function'){
window.onload=func;
}
else{
window.onload=function(){
oldonload();//oldonload指window.onload = func;
func();//该函数追加到的末尾:当前面的执行完之后在执行func()
}
}
}
addLoadEvent(firstFunction);
addLoadEvent(secondFunction);