Skip to content

Latest commit

 

History

History
22 lines (22 loc) · 590 Bytes

前端相关.md

File metadata and controls

22 lines (22 loc) · 590 Bytes

ajax post请求

    var info = ""
    $.ajax({
      url : "http://127.0.0.1:8000/get_answer",
      type : "POST",
      async: false,
      data: JSON.stringify({text: "DBConnectionError: (pymysql.err.OperationalError)"}),
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (response) {
        info = response.data
      },
      error: function(e) {
        console.log("error occured!")
      }
    })
    console.log("info = " + info)
    text = getChatDom("System", "right", info)
    appendChatText(text)
  }