我正在創(chuàng)建一個(gè)通信生成器,它將標(biāo)準(zhǔn)化關(guān)于我公司的關(guān)鍵 IT 事件的 SMS 通信。我有一個(gè) IF/ELSE 語(yǔ)句,用于確定問(wèn)題是新的、更新的還是已解決的,以便將必要的信息匯總在一起并相應(yīng)地對(duì)其進(jìn)行格式化。據(jù)我所知,這里的一切都很好,但是我在寫入文本框('smsToSend')時(shí)遇到了問(wèn)題,應(yīng)該允許用戶在將文本復(fù)制到我們的短信發(fā)送器應(yīng)用程序之前進(jìn)行查看,因?yàn)闆](méi)有正在輸出到此框中。function generateSMS(){ var issueTitle = document.getElementById("incidentTitle"); var advisorImpact = document.getElementById("advisorImpact"; var incidentUpdate = document.getElementById("incidentUpdate"); var incidentStatus = document.getElementById("incidentState"); var startTime = document.getElementById("startTime"); var endTime = document.getElementById("endTime"); var incidentPriority = document.getElementById("incidentPriority"); var incidentBrand = "TechTeam"; var systemImpacted = document.getElementById("systemImpacted"); var incidentReference = document.getElementById("incidentReference"); var smsToSend = document.getElementById("smsToSend"); if (incidentStatus != "Closed"){ smsToSend = "P" + incidentPriority + " " + incidentBrand + "IT RESOLVED: " + systemImpacted + ": " + incidentUpdate + ": Start: " + startTime + " End: " + endTime + " Reference: " + incidentReference;}else{ if (incidentUpdate == "We are investigating this issue"){ smsToSend = "P" + incidentPriority + " " + incidentBrand + "IT ISSUE: " + systemImpacted + ": " + issueTitle + ". " + advisorImpact + ": " + incidentReference; } else { smsToSend = "P" + incidentPriority + " " + incidentBrand + "IT UPDATE: " + systemImpacted + ": " + incidentUpdate + ": " + incidentReference; } }}generateSMS();alert.getElementById(smsToSend);
嘗試使用 Javascript 輸出到文本框
蕪湖不蕪
2021-11-12 17:46:06