Session失效后所有Ajax请求跳转登录地址

75 阅读1分钟
    $(function() {
        $.ajaxSetup({
            complete:function(XMLHttpRequest,textStatus){
                if(textStatus=="parsererror"){
                    window.location.href = '../login.html';
                } else if(textStatus=="error"){

                }
            }
        });
    })