var cableProjectAddressBList = []; function getCableProjectAddressBList(cableTypeCode, cableId, cableAPositionName) { cableAPositionName = encodeURIComponent(cableAPositionName); if (cableTypeCode && cableId && cableAPositionName) { $.ajax({ dataType: "json", url: "ajax.aspx", data: { operationType: ‘getCableProjectAddressBList‘, cableTypeCode: cableTypeCode, cableId: cableId, cableAPositionName: cableAPositionName }, success: function (data, textStatus, jqXHR) { // 如果重新声明对象那么,外部的cableProjectAddressBList不会被改变,疑惑中 //cableProjectAddressBList = []; cableProjectAddressBList.length = 0; for (var i in data) { cableProjectAddressBList.push(data[i].Address); } } }); } }
时间: 2024-10-10 02:31:17