I've got the following function that calls a php file which returns a percentage of a task thats complete.
Can anyone tell me what kind of data do i need to put in the PHP file to pass the percentage to the ajax call and how do i display the percentage on the page? e.g like a jQuery progress bar?
Thanks
function getStatus() {
//check your progress
$.ajax(
{
type: 'GET',
url: "checkProgress.php",
async: true,
success:
function (data) {
//assume the data returned in the percentage complete
var percentage = parseInt(data);
//write your status somewhere, like a jQuery progress bar?
if (percentage < 100) {
//if not complete, check again
getStatus();
}
}
});
}