Skip to content

Instantly share code, notes, and snippets.

@svenliebig
Created June 26, 2017 13:54
Show Gist options
  • Save svenliebig/d49c16617e30c32c879b6862e3f2016c to your computer and use it in GitHub Desktop.
Save svenliebig/d49c16617e30c32c879b6862e3f2016c to your computer and use it in GitHub Desktop.
// pseudocode of doom
function login(username, pw, callback) {
$.ajax(url).success(function(response) {
if(response.code != 404 && response.code == 200) { // redundant, such dir was aus
callback(JSON.parse(response.data));
}
}
}
// aufruf
login("ced", "laier321", function(data) {
console.log("erfolgreicher aufruf");
console.log(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment