Page loading

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

Native JS page loads:

//原生js加载
window.onload=function(){
	//程序代码	
}

Note: After the entire page is loaded, the function is executed. Page load javascript is performed only once, the last performance of the load;

JQuery page loads:

Complicated version:

//复杂版本
$(document).ready(function(){
	//程序代码	
});

Simple version:

//简单版本
$(function(){
	//程序代码	
});

Note: The entire page is loaded before the function is executed. Jquery after the page is loaded, you can perform many times.

 

Guess you like

Origin blog.csdn.net/longyanchen/article/details/93165222