如何使用juqery ajax显示预加载图像 [英] how to show pre loading image using juqery ajax
本文介绍了如何使用juqery ajax显示预加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想显示预加载图像gif,直到数据完全加载
为此,我编写的代码为< br $>
Hi,
I want to show preloading image gif till the data get fully loaded
For this i have written code as
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
$.ajax({
type: "POST",
url: "AjaxSaveDocuPro.aspx?option=filenum&FileNum=" + $("#spfileNum")[0].innerText.trim() + "",
async: false,
success: function (text) {
response = text;
if (text != "") {
}
,ajaxStart: function () {
$("#Pageloading").show();
}
, ajaxStop: function () {
$("#Pageloading").hide();
}
});
但代码无效,我在ajaxstart和ajaxstop中放置了一个调试器,但是bedubugger没有被击中。
But the code is not working , i placed a debugger in ajaxstart and ajaxstop ,but bedubugger is not getting hit.
推荐答案
.ajax({
type:POST,
url:AjaxSaveDocuPro.aspx?option = filenum& FileNum =+
.ajax({ type: "POST", url: "AjaxSaveDocuPro.aspx?option=filenum&FileNum=" +
(#spfileNum)[0] .innerText.trim()+,
async:false,
success:function(text){
response = text;
if(text!=){
}
,ajaxStart:function( ){
("#spfileNum")[0].innerText.trim() + "", async: false, success: function (text) { response = text; if (text != "") { } ,ajaxStart: function () {
(#Pageloading)。show();
}
,ajaxStop:function( ){
("#Pageloading").show(); } , ajaxStop: function () {
这篇关于如何使用juqery ajax显示预加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文