Set everything to display:none;
until the jQuery AJAX success()
method fires, which can then set the display
properties back to normal.
Also, make sure the AJAX code is inside of the window.onload
or $(window).on('load')
handler.
The downside of this is that if the Ajax call is unsuccessful, your page will not display, so you should also define an Ajax error()
method in jQuery.
Edit:
For showing images when they are done loading (Put outside onload):
$('img').each(function()
{
$(this).css('display','none');
$(this).on('load',function(){$(this).css('display','');});
});
Also, you will want to display some type of loading symbol to improve the user experience.