Skip to content

Instantly share code, notes, and snippets.

@notbrain
Created April 6, 2011 07:17
Show Gist options
  • Save notbrain/905265 to your computer and use it in GitHub Desktop.
Save notbrain/905265 to your computer and use it in GitHub Desktop.
function getAjaxResultAndReturnIt() {
$.getJSON("/url", function(json){
if(json.result) {
return true; // will not bubble up as return of function call
} else {
return false; // will not bubble up as return of function call
}
});
}
function getContent() {
var content = getAjaxResultAndReturnIt();
// content = undefined
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment