The page stays on this page. If you jump to this page, you should go to this page {code ...} {code ...} this is buyorder. PHP file {code ...} the result is that the browser wants to buyorder. php? Actlist sends a request, but the page does not jump
The page stays on this page
If you want to jump to this page
Function check () {var rec_id_Array = new Array (); $ ("[name = 'checkboxes']: checked "). each (function () {rec_id_Array.push ($ (this ). val () ;}); listTable. split (rec_id_Array, "Are you sure you want to split the ticket?", "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 ");}}
This is the buyorder. php file.
Elseif ($ _ REQUEST ['act '] = 'split _ Order') {... header ('location: buyorder. php? Act = list'); // After redirection, subsequent code will not be executed exit ;}
The result is that the browser wants to buyorder. php? Act = list: the request is sent, but the page is not redirected.
Reply content:
The page stays on this page
If you want to jump to this page
Function check () {var rec_id_Array = new Array (); $ ("[name = 'checkboxes']: checked "). each (function () {rec_id_Array.push ($ (this ). val () ;}); listTable. split (rec_id_Array, "Are you sure you want to split the ticket?", "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 ");}}
This is the buyorder. php file.
Elseif ($ _ REQUEST ['act '] = 'split _ Order') {... header ('location: buyorder. php? Act = list'); // After redirection, subsequent code will not be executed exit ;}
The result is that the browser wants to buyorder. php? Act = list: the request is sent, but the page is not redirected.
When you submit a page in Ajax mode, PHP cannot control the page Jump at this time. It can only be that Js obtains the page return value, and then jumps to the page through Js.
Yes, I agree with @ youming's statement.
Your request is sent using Ajax. If you want to jump through the browser, you can only return to JS where you want to jump and use it by JS.location
.