JavaScript中是否可以使用多線程? 這是我的JSP頁面的JavaScript部分。 我有這4條件。如果條件將運行4次診斷測試,則在4處。但我想同時運行它們。可能嗎?javascript中的多線程
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";
}
兩個字。網絡工作者。 http://www.html5rocks.com/en/tutorials/workers/basics/ – starbeamrainbowlabs
@starbeamrainbowlabs,那些是兩個字 – Alexander
@Alexander哎呀! :)編輯。 – starbeamrainbowlabs