我在看一个JavaScript,我的同事写的,我认为它看起来像它一样在这两个条款:这些条款是否相同?
function doSubmitOversikt(action, command, status) {
var checked = document.getElementById("klarbox").checked;
if(status && !checked) {
if (confirm("Ärendet är satt som Klar (formell handläggning första delen klar). Vill du verkligen ångra detta? Att ångra kan innebära att ärendet behöver arras om i CICS.")) {
document.actionForm.action.value = action;
document.actionForm.actionCommand.value = command;
document.actionForm.submit();
disableAll();
}
} else {
document.actionForm.action.value = action;
document.actionForm.actionCommand.value = command;
document.actionForm.submit();
disableAll();
}
}
会有什么上面的代码之间的差异,并无条件地做
document.actionForm.action.value = action;
document.actionForm.actionCommand.value = command;
document.actionForm.submit();
disableAll();
?
如果'status == true','checked == false'和'confirm()'对话框被取消,则什么都不会发生。 – Blender