Javascript jquery document ready etc. explain?

(function($) { //code0
‘use strict’;
$(document).ready(function(){
//code1
});

$(window).load(function() {
//code2
});

})(jQuery);

(function($, window, document, undefined) {
‘use strict’;
//code3
})(jQuery, window, document);

Code 0 is same as document ready right? Code1 is with load document ready. Code 2 load content after frames images loaded. Code 3? when is good to use it?

What ypes of codes need to run in document ready? like slider plugins ok
in window load function something about cookie display plugin is fine bit with that code3 ?

Thanks

Thanks for help!!! A good explain is will be good :stuck_out_tongue: