TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rahul Lakshakar
NA
199
41.8k
show loading gif image
Mar 29 2017 3:09 AM
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:
<div class="loading" id="loading" align="center">
Loading. Please wait.<br />
<br />
<img src="image/ajax-loader.gif" alt="" />
</div>
Reply
Answers (
3
)
ajax in asp.net
Event Code: 3005