Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  • Thread Tools
  • Rate This Thread
  1. #1
    New to the CF scene
    Join Date
    Dec 2015
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to delay process so that process gets completed?

    I am executing one php program using ajax which generates image.svg which takes few 5 seconds to complete and I found that the div.success message appears before that and the image does not get updated - it loads the old image. How can I delay the whole div.success and container.html so that new image will be shown as output.

    PHP Code:
    if (range 10000
    {  
        $.
    get("program.php?recordID=0", function(data) {})
        $(
    "div.success").fadeIn(300).delay(11500).fadeOut(400); 
        $(
    "#container").html('<div id="container" style="width: 850px; height: 850px; margin: 0px"><img src="tmp/image.svg" style="width: 850px; height: 850px; margin: 0px"></div>');       

        return 
    false;


  2. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    6,251
    Thanks
    30
    Thanked 859 Times in 857 Posts
    Place your second command in a callback function of the first command.
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •