Created
August 11, 2016 14:31
-
-
Save n1lux/3ed9312dc51adc30d5dc81f54ebf1f08 to your computer and use it in GitHub Desktop.
Ajax Call Back
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
function my_function(id) { | |
var system = getajaxdata(name); | |
system.done(function(data){ | |
var information = data.info; | |
// do stuff with `information` here, not elsewhere. | |
}); | |
} | |
function getajaxdata(name){ | |
return $.ajax({ | |
type:"GET", | |
url: getUrl(), | |
cache: false, | |
dataType: "json" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment