用ecshop开源程序,js里取不到页面的值

代码如下,了解的哥们加我QQ113900176(注明csdn)
/* *

  • 添加商品到购物车
    */
    function addToCart(goodsId, parentId)
    {

    var goods = new Object();
    var spec_arr = new Array();
    var fittings_arr = new Array();
    var number = 1;
    var formBuy = document.forms['ECS_FORMBUY'];
    var quick = 0;

    var fid = "goods_number_"+goodsId;
    if(document.getElementById(fid)){
    number = document.getElementById(fid).value;
    }

    // 检查是否有商品规格
    if (formBuy)
    {
    spec_arr = getSelectedAttributes(formBuy);

    if (formBuy.elements['number'])
    {
    number = formBuy.elements['number'].value;
    }

    quick = 1;
    }

    goods.quick = quick;
    goods.spec = spec_arr;
    goods.goods_id = goodsId;
    goods.number = number;
    goods.parent = (typeof(parentId) == "undefined") ? 0 : parseInt(parentId);

    Ajax.call('flow.php?step=add_to_cart', 'goods=' + goods.toJSONString(), addToCartResponse, 'POST', 'JSON');
    }

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐