I have a javascript which on a "submit" event does the following ajax call(which in turn triggers a python script),my problem now is that "when one submit event is going on if anyone else clicks on the submit button this ajax call should notify that a submission is in progress" ,has anyone ran into this problem?(is there a name?) ,how do fix this problem? Please suggest..
$("#main_form").submit(function(event) {
.....................
$.ajax({
dataType: "json",
type: "POST",
contentType: "application/json",//note the contentType definition
url: "scripts/cherrypick.py",
data: JSON.stringify(data_cp),
//data: data_cp,
error : function (xhr, ajaxOptions, thrownError){
console.log("cherypick fail");
console.log(response);
console.log(response['returnArray']);
alert(xhr.status);
alert(thrownError);
},
success: function(response){
console.log("cherypick sucess");
console.log(response);
console.log(response['returnArray']);
var return_array = response['returnArray'];
console.log(return_array['faillist'].length);
console.log(return_array['picklist'].length);
for (var i = 0; i < ip_gerrits.length; ) {
for (var j = 0; j < return_array['faillist'].length; ) {
if (ip_gerrits[i] != return_array['faillist'][j] )
ipgerrits_pickuplist.push(ip_gerrits[i]);
j++;
}
i++;
}