扩展jQuery的AJAX功能功能、jQuery、AJAX

2023-09-10 17:30:16 作者:我们之间隔片海

我要扩展的AJAX功能,以便每当它被称为的图像出现在页面上,表示有内容加载。

I want to extend the ajax function so that whenever it is called an image appears on the page that indicates there is content loading.

我可以用prefilters作为此网页。 http://api.jquery.com讨论/延长-AJAX / 来显示图像,但我怎么能隐藏图像,一旦请求完成?

I can use prefilters as discussed on this page http://api.jquery.com/extending-ajax/ to show the image but how could I hide the image once the request is complete?

推荐答案

请看看这里:的全局AJAX事件处理

这些使它容易实现加载图像,每当一个Ajax请求是通过jQuery的发送。没有必要延伸

These make it trivial to implement a loading image whenever an ajax request is sent through jQuery. No extending needed.