0

我正在使用以下 jquery 语句来验证用户详细信息。

 $.ajax({
        type: "POST",
        url: "Login",
        data:'uname='+encodeURIComponent(uname)+'&'+'pass='+encodeURIComponent(pass),
        dataType: "json",

        //if received a response from the server
        success: function( data, textStatus, jqXHR) {
             if(data==true)
             {
                 $("#error").show(1500).css({visibility: "visible"});
                  $("#error").append("<b>success!</b>");
              }

但我需要在成功期间将控制权转移到其他 html 页面。

$("#error").show(1500).css({visibility: "visible"});
$("#error").append("<b>success!</b>");

我正在尝试更改上述语句以转移控制权。请任何人帮我解决这个问题。

4

1 回答 1

1

在您成功登录的条件下使用:

window.location ='index1.html'; 
/* or whatever url you want and make sure path is correct relative to page or use absolute url */

这告诉浏览器使用 javascript 打开该 url

于 2013-01-28T13:18:57.060 回答