zoukankan      html  css  js  c++  java
  • 一段诡异的代码,没理解

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

      

  • 相关阅读:
    Python Day7(相关补充)
    Python Day7
    Python Day6
    Python Day5
    Python Day4
    Python Day3
    Python Day2
    Python Day1
    复杂装饰器原理分析
    Unity 坐标
  • 原文地址:https://www.cnblogs.com/MorZe/p/4260941.html
Copyright © 2011-2022 走看看