Jump to content

Load 2nd function after 1st is finished


solon

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/195785-load-2nd-function-after-1st-is-finished/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.