在ajax调用中旋转字体图标
我有下面的ajax代码在ajax调用中旋转字体图标,ajax,Ajax,我有下面的ajax代码 $.ajax({ type: "POST", url: "shoppingcart_service.asmx/RegisterSubscriber", data: "email=" + SubscriberEmail, // the data in form-encoded format, ie as it would appear on a querystring //con
$.ajax({
type: "POST",
url: "shoppingcart_service.asmx/RegisterSubscriber",
data: "email=" + SubscriberEmail, // the data in form-encoded format, ie as it would appear on a querystring
//contentType: "application/x-www-form-urlencoded; charset=UTF-8", // if you are using form encoding, this is default so you don't need to supply it
dataType: "text", // the data type we want back, so text. The data will come wrapped in xml
success: function (data) {
$("#searchresultsA").html(data); // show the string that was returned, this will be the data inside the xml wrapper
},
error: function (request, status, error) {
}
});
}
如何添加onbegin函数来开始旋转调用此函数的按钮,并使用onend ajax函数结束它
我正在使用字体awesome作为gylphicon(),并且我需要显示旋转
<i class="fa fa-arrow-circle-right fa-2x fa-spin"></i> when call begins, there by replacing
<i class="fa fa-arrow-circle-right"></i>
当调用开始时,通过替换
这是按钮的html
<a href="#" class="btn btn-warning btn-block" id="btnSave" ><i class="fa fa-arrow-circle-right"></i></i>Subscribe</a>
示例使用了
jQuery JavaScript库
首先,使用创建一个Ajax图标
然后将以下内容添加到HTML中:
<img src="/images/loading.gif" id="loading-indicator" style="display:none" />
最后,您需要钩住jQuery提供的Ajax事件;一个用于Ajax请求开始时的事件处理程序,一个用于Ajax请求结束时的事件处理程序:
$(document).ajaxSend(function(event, request, settings) {
$('#loading-indicator').show();
});
$(document).ajaxComplete(function(event, request, settings) {
$('#loading-indicator').hide();
});
摘自。示例使用了
jQuery JavaScript库
首先,使用创建一个Ajax图标
然后将以下内容添加到HTML中:
<img src="/images/loading.gif" id="loading-indicator" style="display:none" />
最后,您需要钩住jQuery提供的Ajax事件;一个用于Ajax请求开始时的事件处理程序,一个用于Ajax请求结束时的事件处理程序:
$(document).ajaxSend(function(event, request, settings) {
$('#loading-indicator').show();
});
$(document).ajaxComplete(function(event, request, settings) {
$('#loading-indicator').hide();
});
取自。一个班轮
更多。一个班轮
更多信息。在FA文档中使用以下内容
<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
在FA文档中使用以下内容
<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
它如何回答他关于字体真棒的问题?它如何回答他关于字体真棒的问题?