I have a seperate .js file and namespace for json requests. I have another .js file and namespace for the actual logic.
I can't seem to get the result back in my logic layer.
var jsonResult = Blah.Data.LoadAggregates();
alert(jsonResult);
alert(jsonResult.d.length);
alert(jsonResult.length);
all of the above calls are returning undefined.
Blah.RegisterNamespace("Blah.Data");
(function(Data) {
Data.LoadAggregates = function() {
$.ajax({
type: "POST",
url: "asdf.asmx/GetAggregates",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
???????
},
error: function(msg) {
alert("error" + msg);
}
});
};
})(Blah.Data);