如下: http://127.0.0.1/demo/Home/User/login.html
提交表单后,后台返回一个jumpUrl="Home/Index", 用U('Home/Index')函数生成的。
然后在表单提交的回调函数里这样写
$.post(_post_url,data,function(result){
if(result.code>0){ //失败
$("#msg").html(result.msg);
}else { //成功
$("#msg").html(result.msg);
setTimeout("location.href='"+result.jumpUrl+"'",1000);
}
}); 这个时候页面会跳转到http://127.0.0.1/demo/Home/Home/Index.html多了一个Home.
怎么解决?
最佳答案