|
1火车车厢
本帖最后由 haifding 于 2011-12-24 21:42 编辑
测试网址:http://www.xhuirun.com/goods.php?id=10343
想采集一个“商品总价:”后的价格数字。
<li class="clearfix">
<dd>
<strong>商品总价:</strong><font id="ECS_GOODS_AMOUNT" class="shop">价格应该在这里,实际这里为空</font>
</dd>
</li>
视乎和下面这个脚本关联,想请高手解决~谢谢。
<script type="text/javascript">
var goods_id = 10343;
var goodsattr_style = 1;
var gmt_end_time = 0;
var day = "天";
var hour = "小时";
var minute = "分钟";
var second = "秒";
var end = "结束";
var goodsId = 10343;
var now_time = 1324562448;
onload = function(){
changePrice();
fixpng();
try {onload_leftTime();}
catch (e) {}
}
/**
* 点选可选属性或改变数量时修改商品价格的函数
*/
function changePrice()
{
var attr = getSelectedAttributes(document.forms['ECS_FORMBUY']);
var qty = document.forms['ECS_FORMBUY'].elements['number'].value;
Ajax.call('goods.php', 'act=price&id=' + goodsId + '&attr=' + attr + '&number=' + qty, changePriceResponse, 'GET', 'JSON');
}
/**
* 接收返回的信息
*/
function changePriceResponse(res)
{
if (res.err_msg.length > 0)
{
alert(res.err_msg);
}
else
{
document.forms['ECS_FORMBUY'].elements['number'].value = res.qty;
if (document.getElementById('ECS_GOODS_AMOUNT'))
document.getElementById('ECS_GOODS_AMOUNT').innerHTML = res.result;
}
}
</script>
|
|