document.ready和window.onload
网页加载顺序:域名 > html > js-css > [ready] > img-other > [onload]
1、Dom Ready
$(function(){
// do something
});
$(document).ready(function(){
//do something
});
$().ready(function(){
//do something
});
2、Dom Load
window.onload=function(){
//do something
}
$(window).load(function(){
//do something
})