php - How to preload a document and presenting it on screen only when the browser finish loading data from server -
is there way of presenting on screen @ same time when document, dom, images, ajax's calls, objects , other stuff finished loading?
that instead of showing them "in-parts" browser gets information server.
any solution useful.
set display:none;
until jquery ajax success()
method fires, can set display
properties normal.
also, make sure ajax code inside of window.onload
or $(window).on('load')
handler.
the downside of if ajax call unsuccessful, page not display, should define ajax error()
method in jquery.
edit:
for showing images when done loading (put outside onload):
$('img').each(function() { $(this).css('display','none'); $(this).on('load',function(){$(this).css('display','');}); });
also, want display type of loading symbol improve user experience.
Comments
Post a Comment