相关疑难解决方法(0)

Jquery Ajax正在加载图像

我想为我的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);
    }   
});
Run Code Online (Sandbox Code Playgroud)

如何在此代码中实现加载图像.谢谢

ajax jquery

36
推荐指数
2
解决办法
14万
查看次数

在提交时加载时在按钮上显示微调器图标

我试图在加载提交时在按钮上显示微调器,我已经看到了几个实现并在我的应用程序中尝试过,但它不起作用。这是我试图描述的小提琴。我想提到另一件事,这个 HTML 在我的侧边栏上,并通过 ajax 调用中的 javascript 添加

My JS

        (function () {
            $(document).on("click","#submitbutton", function (event) {
                $(this).addClass('active');
                var formdata = $("#filterdata").serializeArray();
                var url1 = "/SelectUnit";
                $.ajax({url: url1, data: formdata, type: 'GET', async:false .....}).done(function(){
    $(this).removeClass('active');

})
            });
            })();
Run Code Online (Sandbox Code Playgroud)
   

 My CSS
    

.spinner {
          display: inline-block;
          opacity: 0;
          max-width: 0;
    
          -webkit-transition: opacity 0.25s, max-width 0.45s; 
          -moz-transition: opacity 0.25s, max-width 0.45s;
          -o-transition: opacity 0.25s, max-width 0.45s;
          transition: opacity 0.25s, max-width 0.45s; /* Duration fixed since we animate additional hidden width */
        } …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery twitter-bootstrap

5
推荐指数
1
解决办法
5万
查看次数

标签 统计

jquery ×2

ajax ×1

css ×1

html ×1

javascript ×1

twitter-bootstrap ×1