Link to home
Start Free TrialLog in
Avatar of vinodWebDev
vinodWebDev

asked on

20 second delay for page loading

Is there any frontend component (Dojo or javascript) which holds the page to wait for loading for around 20 seconds. I am right now using Dojo with my jsp. help is appreciated
Avatar of SRigney
SRigney
Flag of United States of America image

nothing officially waits to load the page, but the front end does have to load the html before it can display, having large scripts can slow the loading of a page.

Firebug for firefox, or the developer tools for IE8 and Chrome can show you what is loading when to let you see how long things take.  

Also ySlow is a plugin for Firebug in Firefox that analyzes your page to let you know why it's slow.  I like this one better than some of the other tools out there because it works behind a firewall.
You could use jquery.


var $htmlChildren = $('html').children();
$htmlChildren .remove();
setTimeout(function() { $('html').append }, 20000);

Open in new window

Probably should be the below.. since the above is not complete


$(document).ready(function(){
    var $htmlChildren = $('html').children().remove();
    setTimeout(function() { $('html').append($htmlChildren); }, 20000);
});

Open in new window

Avatar of vinodWebDev
vinodWebDev

ASKER

@KiasChaos thanks for the solution. but is there any other way to get this done using plain java script .. or any other ajax frameworks such as Dojo or DWR
I misunderstood, are you trying to prevent the page for loading for a certain amount of time?  Do you mind if I ask why?
Hi there,

This seems to do it.


dojo.ready(function() {
    dojo.require("dojo.NodeList-traverse")
    var html = dojo.query('html').children();
    html.style({display:'none'});
    setTimeout(function() { html.style({display:''}); }, 5000);
});

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of KiasChaos83
KiasChaos83
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sathish David  Kumar N
you do it in back end that means .. in java .
Your thread for some time .
if u use forntend means othe function will excute before what ur function excute .