How can I redirect the parent page from an ajax call in CakePHP?
Question
Does anybody know how to redirect parent page from an ajax call? I made an ajax call to the server and from the controller function that handles the call, I want to go to another page. Usually this function updates an element from current page, but in some cases I want to redirect browser to another page.
Solution
If you want to redirect the page loaded in the browser, you probably need to send some sort of message back in the AJAX call that you can then intercept in javascript and then change the browser location
OTHER TIPS
Have you tried to simply send a "Location" header in the AJAX response?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow