# jQuery: setTimeout() during file upload



## Regicide (Aug 8, 2003)

I have a form that allows a user to upload a file. During upload, I use javascript to get the status of the upload by polling another page with the upload ID. This works fine in Firefox, but for some reason in Opera (and maybe others), the status page is never polled once the upload begins. Once the form is submitted, I use setTimeout() to call a function every second that gets the JSON status object from another page. I am not quite sure why this isn't working in Opera and am pulling my hair out at this point.


```
var uuid = gen_uuid(); // some long string that is unique for this upload
$(document).ready(function() {
    $('#upload_form').attr('action', './?upload_progress_id=' + uuid);
    $('#upload_form').submit(function() {
        setTimeout(upload_progress, 1000);
        return true;
    });
});

function upload_progress()
{
    $.getJSON('/upload/progress/' + uuid + '/', function(data) {
        $('#uploaded').text('Uploaded: ' + data.uploaded);
        setTimeout(upload_progress, 1000);
    });
}
```
I have set breakpoints inside the upload_progress() function and have found that this is never called while using Opera. Any help would be appreciated.


----------

