I am using the s3_direct_upload component. Normally, you enable it by binding your element to a function in the ready or load event like so:
$(function() {
$('#s3-uploader').S3Uploader(
{
remove_completed_progress_bar: false,
progress_bar_target: $('#uploads_container'),
}
);
error handling
$('#s3-uploader').bind('s3_upload_failed', function(e, content) {
return alert(content.filename + ' failed to upload : ' + content.error_thrown + '.');
});
});
What I am having trouble with is how to bind this to the #s3-uploader element when that is dynamically loaded. I am loading the page through a Rails partial so there is no load event fired.
I've looked at the JQuery 'on' method but it requires an event and I'm not sure what event to tie it to.