开发者

Jquery ajax Load catch any to display loading

I have a complex site with lots of jquery loads in various places and in different files. I want to have a single method which renders a loading popup when any of the ajax loads run, without (hopefully) modifying them all.

Anyone know a way to 'catch' any ajax request sta开发者_Python百科rt, and also the request end?

Thanks


I believe what you want to do is register for the ajaxStart and ajaxStop events. These will fire for any jQuery ajax events.


See here. The complete and beforeSend events to achieve the behaviour you are looking for.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜