What i know:
When I make an ajax call on my server, a handler is created, the request is sent, my php script receives the request and processes it, and if I pass it, it sends a response that processes my javascript as I need. I also know that php will continue to process the request, even if the user closes the browser or changes pages (all this is done on the server side, so why not? ^. ^).
What I need to know:
Is an ajax handler killed when a user changes pages on my site? For example: the user is at mysite.com/foo.php. They click on the link that sends the ajax request to my server. The response of this request should be shown in div # resp on foo.php. Then they go to mysite.com/bar.php until they get a response.
If I load the same javascript functions and have the necessary div # resp element on bar.php, can the javascript function that called ajax receive a response from the server and pass it to div # resp on bar.php, thus showing the answer? Or is the original ajax pen no longer available? And if it is no longer available in standard javascript, is there some kind of implantation in jQuery that will allow me to get an answer and show it on bar.php?
I hope this is clear.
Cameron oakenleaf
source share