Skip to content

Instantly share code, notes, and snippets.

@grosscorporation
Created February 11, 2017 02:28
Show Gist options
  • Save grosscorporation/a1ada9fb74c9e4f945949d28f56934c3 to your computer and use it in GitHub Desktop.
Save grosscorporation/a1ada9fb74c9e4f945949d28f56934c3 to your computer and use it in GitHub Desktop.
var parseConfig;
var yourobj = {
_otherMethod: function() {
var text = this._requestText();
},
_requestText: function() {
var url = 'config.json';
$.ajax({
type: 'GET',
url: url,
async: false,
dataType: 'json',
success: function(data) {
parseConfig = data;
}
});
}
};
yourobj._requestText();
console.log(parseConfig);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment