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);
}


}

項目変数が null です。また、JavaScript コードは成功関数のコールバックを通過しません。アラートを出すには Item 変数の値が必要です。誰でも私を助けることができますか?

4

0 に答える 0