JQuery, not mobile: make an ajax call, ignore if it comes back or not, and load a new document. Can it be done?

JQuery, not mobile: make an ajax call, ignore if it comes back or not, and load a new document. Can it be done?

I am using JQuery. Not JQuery mobile.

Please pardon the inaccuracy of the term page, which I generally use to refer to an HTML document. It will probably show up several times in this post. Watusiware says there are no pages, only documents. OK by me. I hope this clarification will help, whatever term I use, and that you will understand that I intend document.

In a given page/document, I'd like to fire off an AJAX call and completely ignore the results. No callback. No dealing with the answer. I don't want to see the answer. Once the AJAX call has been made, and hopefully the target of the call has at least begun to do what I want it to do, I'd like to move away from this page/document and load another in its place.

I would like for the AJAX target document to finish whatever it's doing. I just don't want to have to wait around on the calling page/document. I want to move along to an new page/document, while still having the activities of the AJAX target document continue until completion.


The AJAX call works fine as long as I wait around on the originating page/document until the done callback happens before moving along and loading a new document. I really don't want to wait around though. I'd like to just let the AJAX target do its thing, asynchronously as it were, and have no callback at all, and just move along to a new page/document.

When I remove the callback, but do other things on the calling page/document, that's fine. All seems well, as it should. The called/AJAX page/document does what I want it to do. But if the calling page/document unloads/reloads/goes elsewhere before the AJAX page/document is done, it seems to interrupt things and not complete.

In the end I am not particular about precisely how this happens. That is, I don't particularly care the mechanism used to get this done. I just want the bit o' code in that target/AJAX page/document to run at, or soon after, the exit/unload/reload/transition/whatever-it-is-proper-to-call-it when the calling page/document loads a new page/document and is gone. So feel free to suggest other approaches. I've used AJAX because I am familiar, to some degree, with how it works.