[英]Redirect to a page after ajax post success
我试图在ajax成功后转到页面,但没有成功。这是我的代码
$.ajax({
type: "POST",
data: {kwargs : le_selected },
url: baseurl,
success: function(data){
var url = "http://localhost/ye/index.php/enterprise/q_qwargs/"+data;
$(location).attr('href',url);
}
});
上面的代码将我带到http://localhost/ye/index.php/enterprise/q_qwargs
页面,并http://localhost/ye/index.php/enterprise/q_qwargs
了data
的值。
这里是post
和get
重定向前萤火
我如何才能使其包含被遗漏的数据?
使用此代码
location.href='http://localhost/ye/index.php/enterprise/q_qwargs'+data;
改变这个
var url = "http://localhost/ye/index.php/enterprise/q_qwargs/"+data;
$(location).attr('href',url);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.