A Pen by Secret Sam on CodePen.
Created
October 30, 2013 17:07
-
-
Save ericglasser/7236300 to your computer and use it in GitHub Desktop.
A Pen by Secret Sam.
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
<div id='test-div'> | |
test data | |
</div> |
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
var test1 = $.Deferred(); | |
var test2 = $.Deferred(); | |
var test1Promise = test1.promise(); | |
var test2Promise = test2.promise(); | |
setTimeout(function () { | |
test2.resolve('test1'); | |
},200); | |
setTimeout(function () { | |
test2.resolve('test2'); | |
},300); | |
$.when(test1Promise, test2Promise).then(function (test1, test2) { | |
alert(test1); | |
alert(test2); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment