I have a script that does a jquery AJAX post and then should redirect to a different page. The problem is that it is sometimes redirecting before the post completes. There seems to be a couple of solutions but I can't get any of them to work. Thanks for your help! Here is my code:
$.post("cart.php", { 'products[]':postvalues }, function(data) { });
location.href="index.php";