我有一个功能:
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');
}
但我怎么检查它的被叫?我想显示一个警告框。
有什么想法吗?
答案 0 :(得分:3)
只需在其中放入一些日志并检查您的控制台?
console.log("getPricing just got called with", arguments);
或者如果您没有带控制台的浏览器,您可以随时使用alert
alert("getPricing just got called");