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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.