wuruize888 2017-07-19 13:43 采纳率: 66.7%
浏览 967
已采纳

jquery,ajax问题,谢谢解答

 $(document).ajaxComplete(function (event, xhr, option) {

        if (xhr.responseText == "okLogin") {     //服务器端已经返回了oklogin,到这里为什么就不执行了,是我的代码问题么?
            //alert('oklogin');
            window.location('/MT/system/MTIANCENTRE');
        } else if (xhr.responseText == "errcode") {
            //alert('errcode');
            $("#cos").empty().html("验证码错误!");
        } else if (xhr.responseText == "errother") {
            //alert('errother');
            $("#idone").css("display", "block");
            $("#code").css("display", "none");
            $("#usernames").empty().html("用户名可能错误");
            $("#passwords").empty().html("登录密码可能错误");
            $("#password").empty();
        }
    });
  • 写回答

4条回答 默认 最新

  • 斯洛文尼亚旅游 2017-07-20 01:31
    关注

    location不是函数,是属性
    window.location='/MT/system/MTIANCENTRE';

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?