如何在成功期间转移控件:jQuery到HTML表单



我使用以下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>");

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

成功登录条件下使用:

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

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

最新更新