1. Execution Time
Window.onload must wait until all the elements of the page that include the picture have been loaded before they can be executed.
$ (document). Ready () is executed when the DOM structure is drawn and does not have to wait for the load to complete.
2. different writing numbers
window.onload 
$ (document). Ready () can be written multiple at the same time and can be executed
3. simplified notation
Window.onload No simplified notation
$ (document). Ready (function () {}) can be abbreviated to $ (function () {});
Jquery ---load () method. Load () onload event binding a handler function. If the handler is bound to window () after loading, if the handler is bound to the element, it will be triggered when the content of the element is loaded.
The Jquery code is as follows:
$ (window). Load (function () {
writing code
}); equivalent to the following code in JavaScript
Window.onload = function () {
writing code
}
——————————————————————————————
framejqueryonload< Span style= "font-family: ' Microsoft yahei UI ';" > event. After the change, firefox test normal and smooth, ie > Wait a few minutes. jquery The effect only appeared, the Lily is cold.
initially thought to be in conflict with the method itself that onload loads. The popular view on the Internet is $ (document). Ready () is executed after the page DOM parsing is complete, and the onload event is executed after all resources are ready to complete, that is, $ (document The. Ready () is performed before onload, especially if the page picture is larger, the time difference may be greater. But my page is clear that the pictures are displayed for more than 10 seconds, but also see the effect of jquery out.
deleted theOnLoadLoad the method to try, the result is the same, it seems that there is no need to put the originalOnLoadEvent bindings also use the$ (document). Ready ()ie can you do that? Then debug, found ie onload$ (document). Ready () firefox$ (document). Ready () onload method. This and the online statement does not seem to be exactly the same ah, oh, a little meaning, seems to be closer to the truth.
Turn over the source of jquery to see the $ (document). How to do it:
Copy the code code as follows :
if (jQuery.browser.msie && window = = top) (function () {
if (Jquery.isready) return;
try {
Document.documentElement.doScroll ("left");
} catch (Error) {
SetTimeout (Arguments.callee, 0);
Return
}
and execute any waiting functions
Jquery.ready ();
})();
JQuery.event.add (window, "load", jquery.ready);
The results are clear,ieframefirefox$ (document). Ready () onload method. For embedded frameload The event is executed, so naturally in the original onload< Span style= "font-family: ' Microsoft yahei UI ';" > The bound method executes only after the turn. And this page is just in the test environment, there is an inaccessible resource, the delay of more than 10 seconds is its magnified time difference.
&NBSP;
turn from >>>
jquery $ (document). The difference between ready () and window.onload