Execute script after any ajax request

January 4th, 2021 / by kingjman09

#ajax #javascript #jquery

You can use any of the global ajax events that meet your needs here, you’re probably after $.ajaxComplete() or $.ajaxSuccess().
For example:

FYI, ajaxSuccess() would be called when your request successfully does what is assumed to do, means successfully rendered back from server with a 200 OK response. But ajaxComplete() is something which would be called every time a request is being made to the server, irrespective of whether it goes to “success” block of “error” block of your ajax request,the ajaxComplete() block always gets executed.

Source Stackoverflow.

If you have suggestions and corrections please feel free to drop it in the comments section.

Leave a Reply

Your email address will not be published. Required fields are marked *

seven − five =

close
Kingj Maningo blessed

Thanks for taking the time to reach out. How can I help you?