Created
August 27, 2012 13:31
-
-
Save bittersweetryan/3488409 to your computer and use it in GitHub Desktop.
jQuery Deferrds
This file contains hidden or 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 func1(num){ | |
var dfd = $.Deferred(); | |
if(typeof num= !== 'number'){ | |
dfd.reject('not a number'); | |
} | |
else{ | |
dfd.resolve(num); | |
} | |
return dfd.promise(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment