2 qq13436682136 qq13436682136 于 2014.02.09 15:56 提问

用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
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!