switch (selectedRadioVal) {
case CARD_ORDER_FIELDS:
case CARD_ORDER_IDS:
var items = currentSelect.getElementsByTagName("option");
if (items.length == 0) {
$('#txtCardOrderField').focus();
return;
}
//something like this:if (CARD_ORDER_FIELDS)do this; else do that;
}
如您所见,如果切换语句的值等于 CARD_ORDER_FIELDS 或 CARD_ORDER_IDS(最后一行除外),我将尝试执行相同的操作。是否可以检查此块内的当前值并根据该值执行部分代码?