未捕获的TypeError:GasSupplyDetail.push不是函数

时间:2019-06-13 03:13:49

标签: javascript arrays

我正在尝试将某些字段推入数组,但是出现此错误

    var Add_GasSupply_Detail;
    var GasSupplyDetail = [];
    Add_GasSupply_Detail = function () {
        LPG_Operator = $("#LPG_Operator").val();
        LPG_GaS_Supply = $("#LPG_GaS_Supply").val();
        LPG_Title = $("#LPG_Title").val();

        GasSupplyDetail.push({
            LPG_Operator: LPG_Operator,
            LPG_GaS_Supply: LPG_GaS_Supply,
            LPG_Title: LPG_Title,
        });
      }
Uncaught TypeError: GasSupplyDetail.push is not a function

0 个答案:

没有答案