0

How can I have a jqueryui dialog display "Loading" at the beginning of document.ready (or sooner) and then have it disappear at the end of document.ready.

0

3 Answers 3

1

Set and show your dialog right after the body tag and dismiss it when document.ready.

Sign up to request clarification or add additional context in comments.

Comments

0

Try this it will work in all the browsers even if they are slow in javascript execution like IE 6/7

$(document).ready(function(){

  $("LoadingContainer").dialog('open');

  setTimeout(function(){
    //Put all the stuff here which you want to execute on load

    //Finally close the loading dialog
    $("LoadingContainer").dialog('close');

  }, 400);

});

Comments

0

I would have an element that displays the message, and simply hide it when the document.ready is ready. For example:

$(document).ready(function() {
    // All other loading items
    $("#loadingMessage").hide();
});

Make sure you put the hide() function as the last, that way everything else loads first.

1 Comment

Be sure to style #loadingMessage appropriately and by default set the display to something visible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.