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();
        }
    });

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

xhr= eval('(' + xhr + ')');

打开浏览器的开发者工具调试一下。

window.location="/MT/system/MTIANCENTRE";