且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery的阿贾克斯导入图像

更新时间:2023-12-05 16:19:04

尝试是这样的:

<div id="LoadingImage" style="display: none">
<img src="" />
</div>


<script>
     function ajaxCall()
     {
        $("#LoadingImage").show();

          $.ajax({ 
          type: "GET", 
          url: surl, 
          dataType: "jsonp", 
          cache : false, 
          jsonp : "onJSONPLoad", 
          jsonpCallback: "newarticlescallback", 
          crossDomain: "true", 
          success: function(response) { 
            $("#LoadingImage").hide();
            alert("Success"); 
          }, 
          error: function (xhr, status) {  
            $("#LoadingImage").hide();
            alert('Unknown error ' + status); 
          }    
       });  
     }
</script>