Created
February 21, 2013 16:45
-
-
Save gavinblair/5006093 to your computer and use it in GitHub Desktop.
asynchronous callbacks, passing in a parameter
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 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