|
查看: 958|回复: 3
|
有谁可以解释为什么要用这个?
[复制链接]
|
|
|
function calculatesum01(price,qty,form)
{
var a = parseInt(price);
var b = parseInt(qty);
form.shirtsubtotal.value=a*b;
}
<input type="button" value="Calc" onclick="calculatesum01(this.form.shirtunitprice.value,this.form.shirtqty.value,this.form)" />
这只是比例,我只是不懂为什么要放
(price,qty,form)
(this.form.shirtunitprice.value,this.form.shirtqty.value,this.form)
有谁能解释吗? |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 8-3-2009 04:36 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 8-3-2009 06:48 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 9-3-2009 11:23 AM
|
显示全部楼层
这function是写的有些奇怪, 为什么不直接return result就好了呢?
function calculatesum01(price,qty)
{
var a = parseInt(price);
var b = parseInt(qty);
return a*b;
}
然后
<input type="button" value="Calc" onclick="this.form.shirtsubtotal.value = calculatesum01(this.form.shirtunitprice.value,this.form.shirtqty.value);" /> |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|