Magento – Magento 2 : Show loader till all ajax call not completed

ajaxmagento2

I want to show loader till page not loaded or all Ajax call not completed in frontend and backend both side.

Is it possible in Magento 2.0.7 ?

Best Answer

You can try below ajax call for showing loader during ajax call is runnig.

jQuery.ajax({
    url: url,
    type: 'POST',
    dataType: 'json',
    showLoader: true //use for display loader 
}).done(function (data) {
    return true;
});
Related Topic