Answer: Use the ajaxStart() and ajaxStop() Method 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.
The jQuery load() method is a simple, but powerful AJAX method. The load() method loads data from a server and puts the returned data into the selected element.
You can display the image just before this call to $. ajax() and then hide/remove the image in the post handler function (just before your . empty()/. append(data) calls.
I currently have this code and it's pretty simple
$('#window').load('http://mysite.com/mypage.php');
But it shows the content only after fully loaded and during that duration the #windows element remains empty. I want to show a loading image until the page loads. How should i do it? The jquery site explains nothing about it. (afaik)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With