用Scala实现简单的Web和API服务器(31)

href := "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"

),

(raw("""

function submitForm{

fetch(

"/",

{

method: "POST",

body: JSON.stringify({name: nameInput.value, msg: msgInput.value})

}

).then(response => response.json)

.then(json => {

if (json.success) {

messageList.innerHTML = json.txt

msgInput.valuehttp://www.veick.cn/news/= ""

errorDiv.innerText = ""

} else {

推荐阅读