Reputation: 1
i have this script:
$.ajax({
type: "GET",
url: '/get.php?id=' + c + '&type=1',
dataType: "html"
}).done(function (a) {
$(".playerr:eq(" + b + ")").html(a).show()
});
how can i add an loading image ?
Upvotes: 0
Views: 1478
Reputation: 148110
You can use beforeSend
and success
or done to show and hide the loading image
$.ajax({
type: "GET",
url: '/get.php?id=' + c + '&type=1',
dataType: "html"
}).done(function (a) {
$(".playerr:eq(" + b + ")").html(a).show();
$("#img1").hide();
}).beforeSend(function(){
$("#img1").show();
});
Upvotes: 1