Created
October 20, 2010 22:49
-
-
Save Valid/637515 to your computer and use it in GitHub Desktop.
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
sys = require('sys'); | |
getData = function(field, callback) { | |
console.log('this would get the data from ' + field + ' then continue'); | |
//db.getFromField(field, function(error, response) { | |
//if(!error) { | |
// data = response | |
// callback(data); | |
callback('some data'); | |
//} | |
} | |
runner = function() { | |
// get data from field, 'username' | |
getData('username', function(data) { | |
console.log('now you have ' + data) | |
// Script wouldn't get in here if getData hadn't returned 'data' | |
}) | |
} | |
runner() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment