Home  >  Article  >  Web Front-end  >  Jquery knowledge point 1 The difference between Jquery's ready and Dom's onload_jquery

Jquery knowledge point 1 The difference between Jquery's ready and Dom's onload_jquery

WBOY
WBOYOriginal
2016-05-16 18:12:081055browse

So relatively speaking, jquery ready can improve the response speed of web pages;
The standard writing method of jquery:ready:

Copy code The code is as follows:

$(document).ready(function() {
alert("Loading Ended");
});

a $(document) converts the document of the dom object into a jquery object, and then the jquery method ready() can be called; because the dom object cannot call the jquery method, although their relationship is very close;
jquery:ready Abbreviated form:
Copy code The code is as follows:

$(function() {
alert("Loading Ended");
});

One of the main functions of the ready function is to register events for the dom object:
Copy code The code is as follows:



< head>








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