Q:

How to fire off an AJAX request and redirect AFTER making the request?

I am making use of JQuery to fire off an AJAX request. As soon as that PHP script is initiated I want to redirect my browser to a different page. But the AJAX request must have been fired off successfully, it doesn't matter what that scripts returns. Currently I do the following, but it redirects instantly whilst the script was requested partially.
$.get('process.php');
location.href = 'result.php';

Thanks all for any help

A:

Using the callback should work...
$.get('process.php', null, function(){ location.href = 'result.php'; });

A:

You can use the current JavaScript method that your are using but will have to modify your PHP script to ignore the early abort with ignore_user_abort(true).  
Otherwise, you will have to use a callback (as shown by Quintin) to ensure that the PHP script that you are requesting is fully executed.

