15/08/2022
We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
Add the following code to show the loader till ajax call is not completed in Magento 2
jQuery.ajax({
url: url,
type: 'POST',
dataType: 'json',
showLoader: true //use to display loader
}).done(function (data) {
return true;
});
To start the loader on the ajax call, add the following code
jQuery(‘body’).trigger(‘processStart’);
To stop the loader on the ajax call, add the following code
jQuery(‘body’).trigger(‘processStop’);