开发者

Jquery ajax Load catch any to display loading

开发者 https://www.devze.com 2022-12-21 02:57 出处:网络
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

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

精彩评论

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