Jump to content

Return response to AJAX before script ends


everisk

Recommended Posts

Hi,

 

I have a script where values are passed to another processing script via AJAX. The processing script may takes a few minutes to finish therefore I'd like to return a response to user before process finishes. I have done this is flash form but now with AJAX my code doesn't seem to work. My code is below. Thanks!

 

$response = "Processing is finished";
ob_end_clean();
ob_start();
 header("Connection: close");
echo $response;
 $size = ob_get_length();
 header("Content-Length: $size");
 ob_end_flush();
 flush();           

/// long process goes after this ///

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.