原文地址:
https://blog.csdn.net/u013047803/article/details/51355821
自己的測試代碼
var obj ='{\n' +
'? "creator": "string",\n' +
'? "endTime": "2019-01-09 02:07:16.45",\n' +
'? "id": 0,\n' +
'? "orderNumber": "string",\n' +
'? "serialNumber": "string",\n' +
'? "startTime": "2019-01-09 02:07:16.45",\n' +
'? "state": 0\n' +
'}';
$('#btn').click(function () {
$.ajax({
async:true,
xhrFields:{withCredentials:true},
type:'POST',
contentType:"application/json;charset=UTF-8",
url:'****************',
data:obj,
beforeSend:function (request) {
},
success:function (res) {
if(res.success){
// window.location.href="hello.html";
? ? ? ? ? ? }
}
})
})