0

我有一个像下面这样的电话:

BeginGetDashboardsMethod();
alert('Items');

该呼叫链接到那里:

BeginGetDashboardsMethod()
{

var stop = 'false';
alert('1');
try {
    do {
        Service.GetDashboardsMobile("" + curr_cod_user, SuccessGetDashboardMethod, ErrorGetDashboardMethod);
    } while (stop == 'false')
}
catch (e) {

}
function SuccessGetDashboardMethod(result) {
    alert('2');
    stop = 'true';
    json = result;

    json = JSON.parse(json);
    alert('2');
    ListDashboards(json);
}
function ErrorGetDashboardMethod(err) {
    alert(JSON.stringify(err));
}

function ListDashboards(json) {
    alert('3');
    for (var i = 0; i < json.Dashboards.length; i++) {
        if (json.Dashboards.length === 1)
            Items = "[{key:\'" + json.Dashboards[i].OBV_ST_TITULO + "\', title:\'" + json.Dashboards[i].OBV_ST_TITULO + "\'}]";
        else {
            if (i == 0) {
                Items += "[{key:\'" + json.Dashboards[i].OBV_ST_TITULO + "\', title:\'" + json.Dashboards[i].OBV_ST_TITULO + "\'} ";
            }
            else if (i + 1 == json.Dashboards.length) {
                Items += ",{key:\'" + json.Dashboards[i].OBV_ST_TITULO + "\', title:\'" + json.Dashboards[i].OBV_ST_TITULO + "\'}] ";
            }
            else {
                Items += ",{key:\'" + json.Dashboards[i].OBV_ST_TITULO + "\', title:\'" + json.Dashboards[i].OBV_ST_TITULO + "\'} ";
            }
        }

    }
    obj = eval(Items);
}


}

项目变量为空。并且 javascript 代码不会通过成功函数回调。我需要 Item 变量值来提醒它。任何人都可以帮助我吗?

4

0 回答 0