我有这个脚本:
$.ajax({
type: "GET",
url: '/get.php?id=' + c + '&type=1',
dataType: "html"
}).done(function (a) {
$(".playerr:eq(" + b + ")").html(a).show()
});
如何添加加载图片?
答案 0 :(得分:1)
您可以使用beforeSend
和success
或完成来显示和隐藏加载图片
$.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();
});