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
dom
jquery
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>