title: Using window.location.replace after an Ajax response does not redirect immediately
body: <p>I am implementing facebook connect for authentication. I also want to verify that the email of the user I receive from facebook matches with an internal database (essentially invite list). So I use an ajax call as below. However, the redirect does not happen immediately. The user needs to refresh the window in order to get redirected. Any ideas why and how this can be fixed? Thanks!
  Note that this happens within FB.api which in turn is inside window.fbAsyncInit.</p>
  
  <pre><code>   $.ajax({  
                     type: "POST",  
                     url: "verifyLogin.php",  
                     data: ("email=" + myEmail),  
                     success: function(resp){  
                            if (resp == 'success')
                            {
                                  window.location.replace('/index.php');
                            }
                     },  
                     error: function(e){  
                       alert('Error: ' + e);  
                     }
                     });  
  </code></pre>