Maximus Decimus Maximus Decimus - 1 year ago 73
Ajax Question

Stop or hide loading panel when start an Ajax action

I have this portion of code globally to show the loading panel in my page.

.ajaxStart(function () {
.ajaxStop(function () {

So, it will automatically show the loading panel anytime that I call an ajax action like this:

type: "GET",
url: "localhost:8080/api/data/Test/GetData",
success: doSomething

But just in a particular case I want to avoid displaying the loading panel. Is there a way to call the


within this code .ajax action or there's a workaround to avoid the loading panel for just some ajax actions instead of calling the fadeIn and fadeOut of each ajax action.

Answer Source

To prevent .ajaxStart() from being fired, it's enough to set global:false when you want to call $.ajax().

If $.ajax() or $.ajaxSetup() is called with the global option set to false, the .ajaxStart() method will not fire.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download