Php – How to redirect the parent page from an ajax call in CakePHP

cakephpphpredirect

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.

Best 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