码迷,mamicode.com
首页 > 其他好文 > 详细

一段诡异的代码,没理解

时间:2015-01-29 22:28:38      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:

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

  

一段诡异的代码,没理解

标签:

原文地址:http://www.cnblogs.com/MorZe/p/4260941.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!