I have a mobile application that makes
JqXHR = $.ajax({ url: 'url', data: null, async: true, cache: false, dataType: 'json', type: 'GET', crossDomain: true, timeout: 63000, success: function(data, textStatus, jqXHR) {}, error: function(jqXHR, textStatus, errorThrown) {} });
request. It waits for 63 seconds (so that user interaction at the other end is done through the PHP backend for ~ 62 seconds). Now, if at the same time I decide to cancel this request, I call JqXHR.abort() . In the error handler, I already process / distinguish between real errors and interrupts, which works. Immediately after the cancellation, I want to send another API call to the server to tie the loose ends and make sure my cancellation request is registered.
And there is a problem. Even if I abort() first request, the PHP script is still running on the server, which will not be a problem if it also executes the second request, which will cause it to stop and die (). But this does not happen. The second request is not executed until the first completion.
Any ideas?
jQuery 1.8.2, jQuery Mobile 1.2.0, PhoneGap 2.0.0 and 2.1.0, Apache 2, Linux, PHP 5.3
user1741224
source share