誰能halpe我這個錯誤:JavaScript未捕獲TypeError?
Uncaught TypeError: Cannot read
property 'length' of undefined
當您更改組合應該改變以下的價格值,但它不工作
function update_price_select2(o, element_name)
{
var sel_obj = null;
var element = null;
//price_original = <?php //echo substr($products_price,0,-1); ?>;
//alert("Preço Original:" + price_original);
if (document.getElementById) // DOM3 = IE5, NS6
{
sel_obj = document.getElementById(o);
//alert("sel_obj "+ sel_obj);
element = document.getElementById(element_name);
//alert("element "+ element);
}
//alert(o);
//alert(element_name);
var index = sel_obj.selectedIndex;
//alert(o+" index");
var price_array = option_price[sel_obj.id];
var price = price_array[index];
var price_for_operation = price.substr(0,price.length -1); //the price from the option choosen
if (price_for_operation == '')
{
price_for_operation = 0;
}
//Ao preço original, vamos retirar o preço da variável que este tinha anteriormente.
current_product_price = current_product_price - option_price[sel_obj.id + '_current'];
//Vamos colocar o valor actual da variável seleccionada
option_price[sel_obj.id + '_current'] = price_for_operation;
if (price_for_operation != 0)
{
var final_price = roundNumber(parseFloat(current_product_price) + parseFloat(price_for_operation),2);
final_price = final_price.toFixed(2);
}
else
{
var final_price = current_product_price.toFixed(2);
}
//Nos save the decimal value, without the € or $, so we can use it in the next options call
current_product_price = final_price;
final_price = final_price + money_simbol;
if (final_price != "")
{
display_updated_price(final_price, element);
update_allowbuy(final_price);
}
}
需要一些示例代碼 – 2011-05-12 14:29:21
@Sachin Shanbhag更新 – 2011-05-12 14:32:53
您好,當我裝你的網站我只是錯誤信息第895行的「order is null」。您的消息到底會在哪裏被解僱? – reporter 2011-05-12 14:35:02