Is there a way to detect when a page has finished loading ie all its content, javascript and assets like css and images?
so like:
if(PAGE HAS FINISHED LOADING)
{
// do something amazing
}
and also additionally if the page has been loading for more than 1 min then do something else such as:
if(PAGE HAS BEEN LOADING FOR 1 MIN)
{
// do something else amazing
}
I've seen websites like Apple's MobileMe do similar checks but haven't been able to figure it out in their huge code libraries.
Can anyone help?
Thanks
EDIT: This is essentially what I want to do:
// hide content
$("#hide").hide();
// hide loading
$("#loading").hide();
// fade in loading animation
setTimeout($('#loading').fadeIn(), 200);
jQuery(window).load(function() {
$("#hide").fadeIn();
$("#loading").fadeOut(function() {
$(this).remove();
clearInterval(loadingAnim);
});
setTimeout(function() {
$("#error").fadeIn();
}, 60000);
});
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…