Please don't use jQuery for this in 2018! There is no reason to include an entire external library just to perform this one action which can be achieved with one line:
Change cursor to spinner: document.body.style.cursor = 'wait';
Revert cursor to normal: document.body.style.cursor = 'default';