1.多个函数同时在页面加载时得到执行:addLoadEvent() P83
function addLoadEvent(func){
var oldonload = window.onload;
if(typeof window.onload !='function'){
window.onload = func;
}else {
window.onload = function(){
oldonload();
func();
}
}
}
addLoadEvent(firstFunction);
addLoadEvent(secondFunction);
2.insertAfter() P110
function insertAfter(newElement,targetElement){
var parent = targetElement.parentNode;
if (parent.lastChild == targetElement){
parent.appendChild(newElement);
}else{
parent.insertBefore(newElement,targetElement.nextSibling);
}
}
3.