I have a div:
<div id="content"></div>
And when the page is loaded i call a .load(). This load takes around 10 minutes to finish and during the execution its PHP file return some information telling about the execution status, something like Linux loading. I want do put this information inside the div #content dynamically, but .load() is putting only at the end of the execution. Someone can help me please to do this?
The .load() call:
$("#content").load("/admin/ajax/analyse.php");
jQuery’s ajax interface does not provide a way to get progress updates for a response (even though it claims to be a superset of the browser’s native
XMLHttpRequestobject). Apparantly, such a use case is inconceivable to the jQuery developers:By using the an
XMLHttpRequestdirectly, you can read the current progress of a response in anonreadystatechangeevent handler:This works in the latest versions of most browsers including IE 10, Chrome, and Firefox.
Demos: