jQuery AJAX中断“错误”

I have a .php script that takes very long to complete (anywhere from 30 to 160 seconds).

From a webpage I am able to run this script using the JQuery $.ajax() function. However, if I try to leave the page while the ajax request is in progress the function throws an error 'error', which I alert().

I was wondering however if the .php script continues? Because for my case it doesn't really matter if the webpage doesn't receive the response, as long as the .php script doesnt stop halfway trough.

So: if an $.ajax() is interrupted, does that .php script finish non-the-less?

It is possible to let the script run after closing the connection:

http://php.net/manual/en/function.ignore-user-abort.php

You might want to look into job queues if you have long running scripts which do background tasks.