Skip to content

Instantly share code, notes, and snippets.

@gavinblair
Created February 21, 2013 16:45
Show Gist options
  • Save gavinblair/5006093 to your computer and use it in GitHub Desktop.
Save gavinblair/5006093 to your computer and use it in GitHub Desktop.
asynchronous callbacks, passing in a parameter
var id = "hi";
doifconnected(function(id){
alert(id);
}, id);
function doifconnected(callback, id){
setTimeout(function(){
if(1 == 1) {
callback(id);
}
}, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment