How can I used the local variable b outside of that function, I tried this but it didn't seem to work, the variable b
is still undefined.
$.getJSON("/Home/GetA", function (result) {
$.each(result, function () {
if(this.id == '1'){
}
else{
var a = "string 1";
var b;
$.getJSON("/Home/GetFeatures", { id: this.id }, function (result) {
$.each(result, function () {
var b ="moo";
});
});
var c = a + b;
}
});
});