我想实现一个加载图像我的jquery ajax代码(这是当jquery仍在处理)下面是我的代码:
$.ajax({
type: "GET",url: surl,dataType: "jsonp",cache : false,jsonp : "onjsONPLoad",jsonpCallback: "newarticlescallback",crossDomain: "true",success: function(response) {
alert("Success");
},error: function (xhr,status) {
alert('UnkNown error ' + status);
}
});
如何在此代码中实现加载图像。
谢谢
解决方法
尝试这样:
<div id="LoadingImage" style="display: none">
<img src="" />
</div>
<script>
function ajaxCall(){
$("#LoadingImage").show();
$.ajax({
type: "GET",success: function(response) {
$("#LoadingImage").hide();
alert("Success");
},status) {
$("#LoadingImage").hide();
alert('UnkNown error ' + status);
}
});
}
</script>