Created
August 12, 2014 13:19
-
-
Save dmitry-mukhin/c4dc44490718b499f712 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/lekuc/4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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