例如,我有这样的动作:
Run external JS => Save file => Run External Bat
问题是,JS中有什么方法可以跳过保存文件活动吗?
我想在 JS 中做的是:
if (some condition) {
//Skip the save file activity
}
是否有可能或任何解决方法可以达到相同的结果?谢谢
例如,我有这样的动作:
Run external JS => Save file => Run External Bat
问题是,JS中有什么方法可以跳过保存文件活动吗?
我想在 JS 中做的是:
if (some condition) {
//Skip the save file activity
}
是否有可能或任何解决方法可以达到相同的结果?谢谢
根据您尝试使用 continue 语句完成的任务的上下文,这里可能会有所帮助。在本例中,您使用它来绕过打印 #24。
Outer:
for (var i = 1; i <= 10; i++) {
document.write ("<br />");
document.write ("i: " + i);
document.write (" j: ");
Inner:
for (var j = 21; j <= 30; j++) {
if (j == 24) {
continue Inner;
}
document.write (j + " ");
}
}
//Output:
//i: 1 j: 21 22 23 25 26 27 28 29 30
//i: 2 j: 21 22 23 25 26 27 28 29 30
//i: 3 j: 21 22 23 25 26 27 28 29 30
//i: 4 j: 21 22 23 25 26 27 28 29 30
//i: 5 j: 21 22 23 25 26 27 28 29 30
//i: 6 j: 21 22 23 25 26 27 28 29 30
//i: 7 j: 21 22 23 25 26 27 28 29 30
//i: 8 j: 21 22 23 25 26 27 28 29 30
//i: 9 j: 21 22 23 25 26 27 28 29 30
//i: 10 j: 21 22 23 25 26 27 28 29 30
http://msdn.microsoft.com/en-us/library/ie/8de3fkc8(v=vs.94).aspx
添加一个boolean
名为的变量isSaved
,以便根据您的条件执行。
var isSaved = false;
if( isSaved ) {
//if true save the file
}
//Run External Bat
希望你有一个想法。