Questions tagged «select-case»

11
javascript:在切换情况下使用条件
很抱歉那个愚蠢的问题。如何在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; } 感谢您的任何建议!
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.