The Ready () of jquery implements the Domcontentloaded event, the difference between domcontentloaded and the window Load event
Simply put, the ready () is triggered when the document is loaded, and the pictures and other resources may not be fully loaded, and load is triggered after all the resources have been loaded.
Look at the code for the ready function and it's all clear. The following code adds a comment:
Handle when the DOM was ready ready:function () {//Make sure this DOM is not already loaded I F (!jquery.isready) {//Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443
).
if (!document.body) {return settimeout (Jquery.ready, 13);
}//Remember That's DOM is ready Jquery.isready = true;
If there are functions bound, to execute if (readylist) {//execute all of them
var fn, i = 0;
while (fn = readylist[i++])) {Fn.call (document, JQuery);
}//Reset the list of functions readylist = null; }//Trigger any bound Ready events if (JQuery.fn.triggerHandler) {JQuery (doc
ument). Triggerhandler ("Ready");
}
}
},
The above is the entire contents of this article, I hope you can enjoy.