我如何在该函数之外使用局部变量b,我试过这个但它似乎没有用,变量b
仍未定义。
$.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;
}
});
});