How do I get jquery ajax to remain connected until the external execution of code is done? Code:
$.ajax({
type: "POST",
data: "pro=2",
url:"engine/process.php", // huge data to be processed here and it takes quiet some time
error: function(){
alert('error');
},
success: function(finish){
//php code is complete
}
});
the code works but after some few minutes it returns error alert when the connection is lost. that is the alert('error') which is in the code. due to that the php code will not finish processing.
everything works fine on localhost but not when it is uploaded to the server.