Mark Milford
Mark Milford

Reputation: 1236

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 start, and also the request end?

Thanks

Upvotes: 1

Views: 183

Answers (2)

Bernhard Hofmann
Bernhard Hofmann

Reputation: 10411

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

Upvotes: 1

AxelEckenberger
AxelEckenberger

Reputation: 16936

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

Upvotes: 0

Related Questions