1
我有問題更新IE中使用.update div的內容;我也嘗試過使用innerHTML而沒有成功。我的腳本適用於firefox和chrome,但我也需要使它適用於IE(7和8均不接受這些功能)。任何提示? 在此先感謝。原型的更新不能與IE工作
上下文是一個簡單的購物車,帶有兩個微調按鈕來修改要購買的物品數量。下面的代碼:
<!-- the input (quantity) -->
<input type="text" class="cant" id="m__1" value="0"
size="2" readonly/>
<!-- the price associated with the input -->
<input type="hidden" id="h__1" name="h__1" value="100"/>
<!-- the "addition" spinner button for the quantity -->
<input type=button value=" + " onclick="$('m__1').value++;recalc();"
style="font-size:11px;margin:0;padding:0;width:20px;height:19px;" >
<!-- the js function -->
function recalc() {
total = 0
$$('input.cant').each(function(field) {
var idprice = 'h__' + field.id.substr(3)
var price = parseFloat($F(idprice))
var quant = parseInt(field.value)
total += (quant * price)
});
$('totcart').innerHTML='Total ' + total
return total
}
<!-- the div -->
<div align="right" id="totcart"></div>
任何代碼,說明了什麼? – 2010-04-25 02:01:17