in php, if i submit via ajax, how to redirect to other page when result comes back?
A:
do it in javascript; after you get the result back window.location = "newpage.php"
Marek Karbarz
2009-11-05 08:53:36
is it not appropriate to put navigation logic in client side?
steven
2009-11-05 08:55:44
yeah, but with ajax you can't do it any other way
Marek Karbarz
2009-11-05 08:59:19
thx, your answer is accepted
steven
2009-11-05 09:04:54
A:
If you're using AJAX to redirect pages with Javascript, you're losing all the benefits of AJAX, consider simplifying your system so that it just submits its data with a regular POST.
If you're doing it asynchronously because you want the page to redirect on some specific event that the user has no control over, don't. Instead do something similar to StackOverflow - pop up a little status bar at the top or bottom (or side) of the page with a link for the user to click when they're ready.
MalphasWats
2009-11-05 09:08:32