Your AJAX function:
function ajax_request(url, target){ //url -> URL of the file that will provide the requested data, target -> the div or span element that displays the data
....code to check the HTTP status and until it is 200 and the readyState is 4 do:
document.getElementById(target).innerHTML = ' Fetching data...';
OR
document.getElementById(target).innerHTML = '../path-to-image/';
....code to perform action upon status/state change
}
A good resource to find free-to-use gif loading animations is: http://www.ajaxload.info/
No comments:
Post a Comment