i am sending ajax
request from html page using jquery
to send the bulk
emails and fetch the data from the server.
here is the code to send request for bulk mail
var sendReq = $.ajax({
type: 'post',
data: "leftID="+JSON.stringify(leftID)+"&rightID="+JSON.stringify(rightID)+"&mode="+mode,
dataType: 'json',
url:"bulk.php"
});
sendReq.done(function( data ) {
$("#bms-ack").html(data.status);
$("#bms-ack").fadeIn('slow');
$("#bms-ack").fadeOut(6000);
console.log(data);
console.log("success");
});
sendReq.fail(function(jqXHR, data){
$("#bms-ack").html(data.status);
$("#bms-ack").fadeIn('slow');
$("#bms-ack").fadeOut(6000);
console.log("fail");
});
now the issue is when i send a request to php page it will send mails and respond with success
message.
as the php is returning the response back to the client so will this ajax request going to get blocked ? because when i send another request from jqtable
to fetch new data it takes time until the previous request of ajax to send bulk mail hans't finished. and eventually my jqtable
keeps loading.
how do i get rid of blocking request , should i remove returning success
message from php and if i do so then how the user will know that the request has been submitted ?