Nyein Chan
Nyein Chan

Reputation: 1215

AJAX: What happens to a callback response after page redirect?

When we use ajax request with PHP, the server side usually end with:

exit( json_encode(somedata) ) 

and use this response data in client side but what happen when the server side redirect to another page? What happen to ajax callback method?

Upvotes: 0

Views: 46

Answers (1)

Koby Douek
Koby Douek

Reputation: 16675

After redirecting to a different page, all Javascript callback events are unregistered, so the AJAX callback is not being fired anywhere. It's forever lost in the vastness of the cybernetic world.

enter image description here

Upvotes: 1

Related Questions