Am trying to get data from ajax if success data is empty need to call same ajax until ajax success data is returned.
Can some one help me to call ajax ever 2 sec until ajax returns data.
this.submitPax = function() {
function getCityName() {
var country = 1;
//var ajaxUrl = "<?php echo WEB_URL_ADMIN; ?>checkdriverstatus";
tjq.ajax({
url: baseUrlIs + "checkdriverstatus",
dataType: 'json',
type: 'post',
data: { "countryID": country },
success: function(response, textStatus, request) {
//alert(response);
if (response != '') {
tjq("div#divLoadingSeat").removeClass('show');
} else {
alert('Waiting for driver to accept job');
//setTimeout(function(){getCityName();}, 1000);
tjq("div#divLoadingSeat").addClass('show');
return false;
}
},
});
}
}