What I know:
When I make an ajax call to my server, a handler is created, the request is sent, my php script receives the request and processes it and–if I tell it to–sends back a response, which my javascript parses as I require. I also know that php will continue to process the request even if the user closes the browser or changes pages (its all being done on the server side, so why wouldn’t it? ^.^).
What I need to know:
Is the ajax handler killed when the user changes pages within my site? For example: The user is on mysite.com/foo.php. They click a link that sends off an ajax request to my server. The response of that request is to be shown in div#resp on foo.php. They then navigate to mysite.com/bar.php before the response is received.
If I load the same javascript functions and have the needed div#resp element on bar.php, can the javascript function that called the ajax still receive the response from the server and pass it into the div#resp on bar.php, thus showing the response? Or is the original ajax handle no longer available? And if it is no longer available in standard javascript, is there some implantation in jQuery that will allow me retrieve the response and show it on bar.php?
From what you’re describing, no – once you navigate to another page and cause a page reload, all of your javascript handlers are re-instantiated and the original ones destroyed.