登录后AJAX无法打开页面

时间:2019-06-07 20:45:54

标签: ajax

我尝试使用ajax登录后打开另一个页面,但登录后无法打开以下页面。

$.ajax({
    url:"http://localhost:8081/CC_APIS/apis/login.php",
    method:"POST",
    dataType:"JSON",
    data:{username : u_username,password : u_password},
    success:function(data){
        console.log(data);
        if(data.rows>0){
            window.location.href="lessonBooking.html";
        }else{
            console.log("user not found");
        }
    },
    error:function(err){
        console.log(err);
    }
});

0 个答案:

没有答案
相关问题