Skip to content

Instantly share code, notes, and snippets.

@theednaffattack
Last active March 18, 2017 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theednaffattack/25d24d620cc35b160c17a95756fd1927 to your computer and use it in GitHub Desktop.
Save theednaffattack/25d24d620cc35b160c17a95756fd1927 to your computer and use it in GitHub Desktop.
// get Data from a URI and then run whatever function we want using that data

function getData(dataURI, thingToRun) {
  var myData = getSomeData();
  thingToRun(myData);
}
// the function we're passing as a callback

function logData(data) { console.log(data); }

// passing logData as a callback

getData('http://eff.org', logData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment