This version is old school.
Please find jQuery plugins on npm.
jQuery Waiting
by Thomas Hermann
jQuery Waiting provides a way to add and remove a loading indication (e.g. an AJAX spinner gif) with some useful options like positioning and adding it as an overlay inside the element or over the entire page.