如何防止AngularJS中的页面重新加载或刷新

时间:2017-02-07 07:29:39

标签: javascript php jquery angularjs

$http.get("check_login.php")
.success(function(response) {
    if(response.login == 1 || response.login == 2) {
        window.location.href = 'new.html';
        event.preventDefault();
    }
    if(response.login == 0 || response.login == undefined) {
        window.location.href = 'index.html';
        event.preventDefault();
    }
});

1 个答案:

答案 0 :(得分:0)