There is no document
load
event. The load
event occurs on the window
object.
There is a DOMContentReady
event on the document
which occurs at a different time than the window load
event.
Since you want all resources to be loaded, what you want the window load
event like this:
$(window).on('load', function() {
$('#loading').hide();
});