Hello,
I am trying to show loading gif image before starting of ajax and hide after its completion but it's not working. can anyone guide me ?
My code is for ajax function:
onSave: function (data) {
$.ajax({
type: "POST",
url: pageUrl + "/GetCapturedImage",
data: '',
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: function(){
$('#loading').show()
},
complete: function(){
$('#loading').hide();
},
success: function (r) {
$("[id*=imgCapture]").css("visibility", "visible");
$("[id*=imgCapture]").attr("src", r.d);
},
failure: function (response) {
alert(response.d);
}
});
}
and for HTML:
Loading. Please wait.

3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bryian TanPosted Mar 30, 2017, 10:41 PM
Rahul LakshakarPosted Mar 30, 2017, 4:48 AM
Bryian TanPosted Mar 29, 2017, 10:28 PM