1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| var uploadUpdateInterval = null;
var uploadUpdateBusy = false;
var uploadStarted = false;
function uploadStart() {
clearInterval(uploadUpdateInterval);
uploadUpdateInterval = setInterval(function() {
uploadUpdate();
}, 500);
uploadStarted = true;
}
function uploadUpdate() {
if(uploadUpdateBusy) {
return false;
}
uploadUpdateBusy = true;
$.post('uploadAjax', { a : 'state', key : uploadKey }, function(resp) {
var json = eval('('+resp+')');
uploadUpdateBusy = false;
});
} |
Partager