开发者

Issue with respond time loader

I am usign jquery ajax method to send data to another page. But issue is I want to show response loader while fetching result from other page. I have id of img is #ajaxloader. BUt issue is when I show it, it continue to res开发者_如何学编程pond. that is if result is fetched its not hiding loader...I got script from google... but as I am sending data though $.post(), jquery method. What should I replace for, .ajaxsend and .ajaxStop.

$().ajaxSend( function( r, s ) {
$("#ajaxloader").show();
});
$().ajaxStop( function( r, s ) {
$("#ajaxloader").fadeOut();
});


Use the success callback in $.post instead:

$('#ajaxloader').show();
$.post(url, data, function() {
    $('#ajaxloader').fadeOut();
});

http://api.jquery.com/jQuery.post/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜