If I've a page which contains below:
1. HTML with text and images.
2. Lots of reference to CSS and Large JS Files.
3. Within HTML a call similar to one below:
$(document).ready(function () {
$.ajax({
url: "http://fiddle.jshell.net/favicon.png",
beforeSend: function( xhr ) {
xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
}
})
.done(function( data ) {
if ( console && console.log ) {
console.log( "Sample of data:", data.slice( 0, 100 ) );
}
});
}
Could someone please clarify if my understanding below is correct, in terms of which one gets loaded first?
ready
is guaranteed to be invoked after the DOM is ready, nothing more. This definitely will not have loaded "all HTML and images", specifically images may or may not have been loaded.