I’ve built an app that pulls in content on document load and have noticed that window load seems to fire when the pages initial content has loaded. Is that the case? Is there some kind of boolean magic I can throw in to the window load event to make it wait until the initial content and new content has finished?
Here’s what I’m working with
$doc.ready(function(){
/* Pull in conditional content */
});
$win.load(function(){
/* Fade page in once initial page content
and conditional content have both loaded */
});
Yes, the
window.onloadevent fires when the DOM and all assets (images, CSS) are loaded.No, there’s no such magic. I suggest you fade your page in from the callback of the operation that loads the dynamic content.