Home  >  Article  >  Web Front-end  >  Introduction to the difference between window.onload and $(function(){})_Basic knowledge

Introduction to the difference between window.onload and $(function(){})_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 17:18:211113browse
Copy code The code is as follows:

window.onload=function{}

Indicates that after the page is loaded (including dom and js), the content in the function will be executed;
Copy the code The code is as follows:

$(function(){})

means that after the page (dom) is loaded, the content in the function will be executed.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn