Use the ajaxStart() and ajaxStop() Method
While working with Ajax, showing a loading spinner or displaying a message with some animation like "Loading... Please Wait" is popular way to indicate the user that Ajax request is in progress. You can create a preloader using the jQuery ajaxStart() and ajaxStop() method.