solon Posted March 19, 2010 Share Posted March 19, 2010 Hey guys... this is the script i have: <script type="text/javascript"> function remove(x) { $.blockUI({ message: '<h1>Item is being removed from your Cart...</h1>' }); $('#s_cart').load('remove.php',{ pr : x, success: setTimeout("$('#shop_cart').load('thecart.php')",2000) //this one give me the wrong result }); setTimeout($.unblockUI,3000); } </script> As i understand from Firebug it actually executes after the first is done but i have a problem... The thing is that i am just loading the result of a php file that when it runs directly(not through jquery call) it gives me correct result ( i ask for the items in cart at that time). If i go through the jquery call it gives me an empty result. I am not sure if it's the timing the function is called or something else. If you have any advise please let me know Thanks in advanced, Solon Quote Link to comment https://forums.phpfreaks.com/topic/195785-load-2nd-function-after-1st-is-finished/ Share on other sites More sharing options...
beta0x64 Posted March 20, 2010 Share Posted March 20, 2010 What do you mean by an empty result? This sounds like one of those problems caused by a technicality. Also, could you try calling it without a timeout, just to rule that out? Quote Link to comment https://forums.phpfreaks.com/topic/195785-load-2nd-function-after-1st-is-finished/#findComment-1029324 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.