Skip to content

Instantly share code, notes, and snippets.

@ichi
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save ichi/ceefd49834caa975d9fd to your computer and use it in GitHub Desktop.

Select an option

Save ichi/ceefd49834caa975d9fd to your computer and use it in GitHub Desktop.
var defer1 = new $.Deferred(),
defer2 = new $.Deferred();
// ready
$(function(){
defer1.resolve();
});
// load
window.onload = function(){
defer2.resolve();
};
// 全部オワタ
$.when(defer1, defer2).done(function(res1, res2){
// もろもろ
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment