Hi there,
I have this code
var stats = {
GetMetaData : function() {
var url = 'http://www.bungie.net/api/reach/reachapijson.svc/game/metadata/'+storage.get('apikey');
$.ajax({
url: url,
success: function(data) {
return data;
}
});
return 'abc';
}
}
I call the function using stats.GetMetaData();
I would expect the value returned to be the data
variable from the ajax request.
But instead it is the string 'abc' why is this?
How can I return the data
variable?
I tried doing return $.ajax({
but that just return the function code.