-3
我有一个函数:如何检查函数是否被调用?
function getPricing(ProductID,VariantID)
{
//alert('VariantID=' + VariantID);
if(ProductID == undefined || VariantID == undefined)
{
return;
}
var ChosenSize = "";
//var ChosenSizeList = document.getElementById('Size');
var ChosenSizeList = document.getElementById('AddToCartForm_' + ProductID + '_' + VariantID).Size;
if(ChosenSizeList != undefined)
{
ChosenSize = ChosenSizeList.options[ChosenSizeList.selectedIndex].text;
}
var ChosenColor = "";
//var ChosenColorList = document.getElementById('Color');
var ChosenColorList = document.getElementById('AddToCartForm_' + ProductID + '_' + VariantID).Color
if(ChosenColorList != undefined)
{
ChosenColor = ChosenColorList.options[ChosenColorList.selectedIndex].text;
}
var url = "ajaxPricing.aspx?ProductID=" + ProductID + "&VariantID=" + VariantID + "&size=" + escape(ChosenSize) + "&color=" + escape(ChosenColor);
//alert("Ajax Url=" + url);
makeHttpRequest(url,undefined,'pricing');
}
但我怎么检查其被称为?我想显示一个警告框。
任何想法?
你是什么意思“检查,其被称为”?你有什么尝试? –
好的,在你的代码开始处删除这两个斜线,'/ /'。你想要的'alert'会出现..编辑:嗯..?有人提出这个问题? –
取消注释// //提醒('VariantID ='+ VariantID);'? – Matt