Skip to content

Instantly share code, notes, and snippets.

@dmitry-mukhin
Created August 12, 2014 13:19
Show Gist options
  • Save dmitry-mukhin/c4dc44490718b499f712 to your computer and use it in GitHub Desktop.
Save dmitry-mukhin/c4dc44490718b499f712 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script>
UPLOADCARE_PUBLIC_KEY = 'demopublickey';
</script>
<script charset="utf-8" src="https://ucarecdn.com/widget/1.4.0/uploadcare/uploadcare-1.4.0.min.js"></script>
</head>
<body>
<form>
<input type="hidden" role="uploadcare-uploader" data-multiple="true" />
<input type="submit" id="submit">
</form>
<script id="jsbin-javascript">
// use jQuery shipped with Uploadcare
$ = uploadcare.jQuery;
var widget = uploadcare.MultipleWidget('input');
// disable submit button
$('#submit').attr('disabled', true);
widget.onUploadComplete(function(info) {
// upload is complete
console.log(info);
console.log('onUploadComplete');
// enable submit button
$('#submit').attr('disabled', false);
// trigger click event
$('#submit').trigger('click');
})
</script>
</body>
</html>
// use jQuery shipped with Uploadcare
$ = uploadcare.jQuery;
var widget = uploadcare.MultipleWidget('input');
// disable submit button
$('#submit').attr('disabled', true);
widget.onUploadComplete(function(info) {
// upload is complete
console.log(info);
console.log('onUploadComplete');
// enable submit button
$('#submit').attr('disabled', false);
// trigger click event
$('#submit').trigger('click');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment