I am trying to make the following recursive function work but keep receiving an error (following code):
var checkStatus = function(jobID) {
$.ajax({
type: 'post',
url: '/admin/process/check-encode-status.php',
data: {jobID: jobID},
success: function(data) {
if (data == 'processing') {
checkStatus(jobID).delay(2000);
} else {
$("#videoOutput").html(data);
}
}
});
};
The error I am receiving is: checkStatus(jobID) is undefined
Everything seems to be working as it should, Firebug is just throwing this warning. The function is repeating itself, posting the jobID and receiving "processing" from the PHP script.
I had a similar script that I was using that used setTimeout() to be recursive but I could not figure out how to pass the jobID along with calling the function (errors).
Any ideas? Thanks!