How to show loader widget in ajax call Magento 2?

You can show Magento native loader widget icon on a page for an ajax request.

You can start the loader once the ajax request is started and you can stop loader widget after the response is getting or failed the response.

Its simple to add loader widget icon for an ajax request.

You can start loader widget by calling below line,
jQuery(‘body’).trigger(‘processStart’);

You can disable loader widget icon by below line,
jQuery(‘body’).trigger(‘processStop’);

Full example for ajax call,