Home > Web Front-end > JS Tutorial > 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
Release: 2016-05-16 18:12:08
Original
1099 people have browsed it

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>








Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template