很抱歉那个愚蠢的问题。如何在javascript切换案例语言元素中为案例使用条件?像下面的示例一样,当变量liCount
<= 5和> 0时,大小写应该匹配;但是,我的代码不起作用:
switch (liCount) {
case 0:
setLayoutState('start');
var api = $('#UploadList').data('jsp');
api.reinitialise();
break;
case (liCount<=5 && liCount>0):
setLayoutState('upload1Row');
var api = $('#UploadList').data('jsp');
api.reinitialise();
break;
case (liCount<=10 && liCount>5):
setLayoutState('upload2Rows');
var api = $('#UploadList').data('jsp');
api.reinitialise();
break;
case (liCount>10):
var api = $('#UploadList').data('jsp');
api.reinitialise();
break;
}
感谢您的任何建议!