Why we need to open inspect element or fire alert message to execute jquery function further.
I used bootstrap modal popup to show progress by (enabling progress bar on modelpopup)
some time it doesn't response when I enable inspect element or write console log it started to run...
Here is code----
$(document).on('click', '#btnP', '', function () {
$('#temp').html('');
$('#temp').append($('#drop-field').html());
First("Test");
});
function First(e) {
if ($('#btnPrinterName').find('span').eq(0).text() == 'Select Printer Name') {
alert('Please Select Printer Name');
return false;
}
$('#divProgressBar').css('width', "0px");
$('#myModall').modal({ backdrop: 'static', keyboard: false });
console.log($('#temp').html());
$.ajax({
type: "GET",
contentType: "application/json;charset=utf-8",
url: 'http://apiNW.com/api/forFirst',
dataType: "json",
success: function (data) {
$.each(data[Object.keys(data)[0]], function (key, value) {
if ($('#temp').children("span[data-key='" + key + "]").length)
{ $('#temp').children("span[data-key='" + key + "]").text(value); }
});
$('#progress').css('width', "42px");
Second(e);
},
error: function (data) {
$.ajax(this);
}
});
}
function Second(e) {
$.ajax({
type: "GET",
contentType: "application/json;charset=utf-8",
url: 'http://apiNW.com/api/forSecond',
xhrFields: { withCredential: true },
dataType: "json",
success: function (data) {
$.each(data[0], function (key, value) {
if ($('#temp').children("span[data-key=" + key + "]").length) { $('#temp').children("span[data-key=" + key + "]").text(value); }
});
$('#progress').css('width', "84px");
Third(e);
},
error: function (result) {
$.ajax(this);
console.log(result);
}
});
}