Deferred Utility
Download the production version or the development version.
In your web page:
<script src="jquery.js"></script>
<script src="dist/deferred-util.min.js"></script>
<script>
jQuery(function($) {
// Like setTimeout,
$.wait(100).done(function() {
// this callback called after 100ms.
});
var sequence = $.Sequence();
// You can define steps, which are called added order.
sequence.add(function() {
// first.
// The return value delays next step call
return $.get('/foo.json').done(function() { /* process.. */ });
});
sequence.add(function() {
// second.
return $.get('/bar.json').done(function() { /* process.. */ });
});
sequence.add(function() {
// third.
return $.get('/buz.json').done(function() { /* process.. */ });
});
sequence.play();
});
</script>
(Coming soon)
(Coming soon)
(Nothing yet)