Skip to content

Instantly share code, notes, and snippets.

@sbalko sbalko/index.html
Created Mar 16, 2016

What would you like to do?
Asynchronously loading first jQuery and then the Clipchamp API
<script async src=""></script>
<!-- Build up your initial document statically here. -->
<script type="text/javascript">
(function waitFor(condition, callback) {
(function poll() {
if (condition()) return callback();
else setTimeout(poll, 100);
})(function() {
return typeof $ === 'function';
}, function() {
$('body').append('<script src=""></script>');
waitFor(function() {
return !!$.clipchamp;
}, function() {
// use the Clipchamp API with jQuery here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.