serializeJSON(postMan中使用json形式)
serializeJSON教程
cdn
<%--seralizeJson--%>
<script src="https://cdn.bootcss.com/jquery.serializeJSON/2.8.1/jquery.serializejson.js"></script>
javascript
![4994935-21039f6430d420f8.png](https://i.iter01.com/images/0b082915016a63c9cf1587a72fad6f1c143ebe4e70cb4da3971e9c47531af950.png)
image.png
$.ajax({
url:"newTopic",
dataType: "json",
contentType:"application/json;charset=UTF-8",
type:"post",
data:JSON.stringify($('#topicForm').serializeJSON()) ,
beforeSend:function(){
$("#sendBtn").text("釋出中").attr("disabled","disabled");
},
success:function(json){
if(json.status == "success"){
window.location.href="/topicDetail?topicid="+json.data.id;
}else {
swal("新增主題異常");
}
},
error:function(){
swal("伺服器異常");
},
complete:function () {
$("#sendBtn").text("釋出主題").removeAttr("disabled");
}
})
控制器
![4994935-8510ecf832dd69fb.png](https://i.iter01.com/images/3e213fbfd27185beb4c445084e49b2039f9c544bc456fcd06706d25b2d722f5b.png)
image.png
相關文章
- JSON形式跨域JSON跨域
- 【Postman】6 Postman 傳送post請求-Json格式PostmanJSON
- postman 使用Postman
- Postman使用Postman
- 『政善治』Postman工具 — 8、Postman中Pre-request Script的使用Postman
- Postman 快速使用Postman
- postman的使用Postman
- JSON簡介(java中的json庫使用)JSONJava
- Nginx 的 access log 如何以 json 形式記錄?NginxJSON
- PostMan該如何使用Postman
- postman 使用說明Postman
- postman 使用入門Postman
- postman 工具使用TipsPostman
- postman(二):使用postman傳送get or post請求Postman
- JSON在Python中的使用JSONPython
- postman的簡單使用Postman
- Postman 使用教程詳解Postman
- Postman Pre-request 使用Postman
- 4.postman的使用Postman
- Postman 使用小技巧/指南Postman
- java中json的使用方法JavaJSON
- 『政善治』Postman工具 — 9、在Postman中使用斷言Postman
- 『政善治』Postman工具 — 10、Postman中對Cookie的操作PostmanCookie
- 『政善治』Postman工具 — 11、Postman中對Cookie的操作PostmanCookie
- Postman 常規使用記錄Postman
- Postman變數使用指南Postman變數
- Postman 正確使用姿勢Postman
- MySQL 中 JSON 欄位的使用技巧MySqlJSON
- MySQL中JSON欄位的使用技巧MySqlJSON
- postman中各種變數Postman變數
- JSON 使用JSON
- 使用PostMan進行API測試PostmanAPI
- 使用postman建立Marketing Cloud的ContactPostmanCloud
- 『政善治』Postman工具 — 12、Postman中實現資料驅動Postman
- 『政善治』Postman工具 — 7、Postman中儲存請求(Collections集合)Postman
- mac 使用 sed 抽取 json 中的欄位MacJSON
- SQLite中SELECT基本形式SQLite
- API測試之Postman使用全指南APIPostman
- Postman之API測試使用全指南PostmanAPI