繁体   English   中英

ajax发布成功后重定向到页面

[英]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_qwargsdata的值。

这里是postget重定向前萤火

在此处输入图片说明 我如何才能使其包含被遗漏的数据?

使用此代码

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM