Created
February 11, 2017 02:28
-
-
Save grosscorporation/a1ada9fb74c9e4f945949d28f56934c3 to your computer and use it in GitHub Desktop.
This file contains 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
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