I have the following code that should redirect to the index page of my website after the AJAX method completes. It redirect however the page doesn't have any content loaded, it is just an empty page with a background.

```
function login(){
    var uname = document.getElementById("UserName").value;
    var upass = document.getElementById("Password").value;

    var response = $.ajax({ type: "POST",
        url: "../../php_scripts/ajax.php",
        data: "call=login(" + uname + ", " + upass + ")",
        async: false
    }).responseText;

    window.location.replace("http://www.domainname.com");
}

```

What could cause this problem? could this be a server issue?

[EDIT]

Also if I put the redirect call above the AJAX everything loads correctly.

[EDIT 2]

If I use an asynchronous AJAX with callback method of any kind it causes exact same problem. I'm beginning to think that this is a jQuery bug.