Windows Location don't redirect after XMLHttpRequest
<p>I have these code with a XMLHttpRequest:</p>

<pre><code>function Registrarse()
{
    conexionRegistrarse = new XMLHttpRequest();
    conexionRegistrarse.onreadystatechange = procesarRegistro;
    conexionRegistrarse.open('GET', 'index.php?registrarse=&amp;username='+username+'&amp;mail='+mail+'&amp;pw='+contraseña+'&amp;pwr='+repetircontraseña, true);
    conexionRegistrarse.send();
}

function procesarRegistro()
{
    var detalles = document.getElementById("labelUsername");

    if(conexionRegistrarse.readyState == 4)
    {
        if((conexionRegistrarse.responseText).indexOf("cuenta") == -1)
        {
            window.location = "http://localhost/index.php?creada";
        }
        else
        {
            detalles.innerHTML = conexionRegistrarse.responseText;
        }
    }
    else
    {
        detalles.innerHTML = "Cargando...";
    }
}
</code></pre>

<p>The problem is that when a succesfull register happen (these occurs when the responseText of the xmlhttprequest don't have the string "cuenta"), don't redirect me to: "index.php?creada". I try with assign() and neither work.</p>