Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
Results 1 to 2 of 2
-
12-06-2015, 10:55 AM #1New 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;
}
-
12-06-2015, 08:34 PM #2Master Coder
- 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.



Reply With Quote
