页面停留在这个页面
如果跳转应该到这个页面
function check(){ var rec_id_array = new array(); $([name='checkboxes']:checked).each(function () { rec_id_array.push($(this).val()); }); listtable.split(rec_id_array, 確定拆分訂單嗎, split_order,{$order_mode});}listtable.split = function(id, cfm, opt, order_mode){ if (opt == null) { opt = split; } if (confirm(cfm)) { response.addheader(access-control-allow-origin, http://segmentfault.com/); var args = act= + opt + &id= + id + &order_mode= + order_mode; ajax.call(this.url, args, this.listcallback, get, json); }}
这个是buyorder.php文件
elseif ($_request['act'] == 'split_order') {.......header('location: buyorder.php?act=list'); //确保重定向后,后续代码不会被执行 exit;}
结果就是浏览器想buyorder.php?act=list发出了请求,但是页面没有跟着跳转
回复内容:
页面停留在这个页面
如果跳转应该到这个页面
function check(){ var rec_id_array = new array(); $([name='checkboxes']:checked).each(function () { rec_id_array.push($(this).val()); }); listtable.split(rec_id_array, 確定拆分訂單嗎, split_order,{$order_mode});}listtable.split = function(id, cfm, opt, order_mode){ if (opt == null) { opt = split; } if (confirm(cfm)) { response.addheader(access-control-allow-origin, http://segmentfault.com/); var args = act= + opt + &id= + id + &order_mode= + order_mode; ajax.call(this.url, args, this.listcallback, get, json); }}
这个是buyorder.php文件
elseif ($_request['act'] == 'split_order') {.......header('location: buyorder.php?act=list'); //确保重定向后,后续代码不会被执行 exit;}
结果就是浏览器想buyorder.php?act=list发出了请求,但是页面没有跟着跳转
你是用ajax方式提交的页面,这时候php是没办法控制页面跳转的,只能是js获取到页面的返回值,然后通过js来跳转页面。
是的, 同意 @有明 的说法.
你的请求是用ajax发出的,你如果想要浏览器跳走,那么你只能返回给js你要跳到哪里,然后由js来使用 location 来进行跳转.
