Jquery PHP没有响应函数

I Have a PHP script which need to be run in background and with the help of

ignore_user_abort(true);

Script can be run even close the browser.

But I don't want to close browser every time,

$.ajax({ 
        type: 'POST',
        url: 'myphp.php',
        data: values,
           success: function(re) {alert("somthing");} 
});

browser always wait for AJAX response even without mentioning of success:

Is there any way to stop browser waiting time, so that user can browse website normally without waiting for finishing of php script.

handle request with jQuery XHR

var xmlHttpRequest = $.ajax( {
  //....
});

xmlHttpRequest.abort(); 

At the beginning of your PHP code try to put this :

ob_start();
ob_end_flush();

That will send content to your ajax script and stop it.

I didn't try so it's just an idea ;)

You could try

fclose(STDIN);
fclose(STDOUT);
fclose(STDERR);

though apparently whether it works depends on the exact PHP version. Or you could just terminate the AJAX call from the client side after a while (possibly after you start receiving content).

That said, the essence of AJAX calls is that "user can browse website normally without waiting" even while they are running, so I'm not sure there is a point to what you are trying to do.