javascript中可以使用多线程吗?这是我的 JSP 页面的 javascript 部分。我有这 4 个 if 条件。4 if 条件中的 copde 将运行 4 次诊断测试。但我想同时运行它们。可能吗?
if(document.getElementById("VoiceNode").style.display=="block" && document.getElementById("voiceTest-0").style.display=="none"){
alert("calling voice test");
document.getElementById("voiceTest-0").style.display="block";
kbdOnnetVoiceTestAjaxCall.init('<%=contextPath%>','<%=Service.getServiceID()%>','<%=Service.getInventory().getTelephoneNumber()%>','<%=Service.getInventory().getPort()%>','<%=Service.getInventory().getDslam()%>','<%=Service.getInventory().getSlot()%>','${KBDResultsTimeout}','true')
document.getElementById("moreVoice").style.display="block";
alert("exiting voice test");
}
if(document.getElementById("sessionTest-0").style.display=="none"){
document.getElementById("sessionTest-0").style.display="block";
kbdOnnetSessionTestAjaxCall.init('<%=contextPath%>','<%=Service.getServiceID()%>','<%=Service.getInventory().getTelephoneNumber()%>','<%=Service.getInventory().getPort()%>','<%=Service.getInventory().getDslam()%>','<%=Service.getInventory().getSlot()%>','${KBDResultsTimeout}','true')
document.getElementById("moreSession").style.display="block";
}
if(document.getElementById("lineTest-0").style.display=="none"){
document.getElementById("lineTest-0").style.display="block";
kbdOnnetLineTestAjaxCall.init('<%=contextPath%>','<%=Service.getServiceID()%>','<%=Service.getInventory().getTelephoneNumber()%>','<%=Service.getInventory().getPort()%>','<%=Service.getInventory().getDslam()%>','<%=Service.getInventory().getSlot()%>','${KBDResultsTimeout}','true')
document.getElementById("moreLine").style.display="block";
}
if (document.getElementById("syncTest-0").style.display=="none"){
document.getElementById("syncTest-0").style.display="block";
kbdOnnetSyncTestAjaxCall.init('<%=contextPath%>','<%=Service.getServiceID()%>','<%=Service.getInventory().getTelephoneNumber()%>','<%=Service.getInventory().getPort()%>','<%=Service.getInventory().getDslam()%>','<%=Service.getInventory().getSlot()%>','${KBDResultsTimeout}','true')
document.getElementById("moreSync").style.display="block";
}