user15618
user15618

Reputation: 3

How can I redirect the parent page from an ajax call in CakePHP?

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.

Upvotes: 0

Views: 2399

Answers (2)

Tom Haigh
Tom Haigh

Reputation: 57815

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

Upvotes: 2

activout.se
activout.se

Reputation: 6106

Have you tried to simply send a "Location" header in the AJAX response?

Upvotes: 0

Related Questions