Potheek Potheek - 4 months ago 56
Ajax Question

Add AJAX loader gif in prestashop

I have two questions regarding prestashop.

1) How do I add an ajax loader image in prestashop for an ajax call?

2) Can I add an AJAX loader image to every ajax call in prestashop by placing some code in one place?

I am new to prestashop, so pardon my naive question if it is.


You can add this script which will listen to all AJAX calls

//listen to ajax start event
$( document ).ajaxStart(function() {

//listen to ajax complete event
$( document ).ajaxComplete(function() {

You loader html should be something like this

<img id="my_loader" src="..." />