Last active
August 29, 2015 14:24
-
-
Save kavitshah8/3f349f1d76fcbfc4af5d to your computer and use it in GitHub Desktop.
Callback
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
jQuery = { | |
get: function(url, callback) { | |
// do some XHR and get response back from the server | |
if (response.status === 200) { | |
callback(response.data); | |
} | |
} | |
} |
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 url = '/foo.com'; | |
jQuery.get(url, function(data) { | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment