Object 형태의 data에 JSON.stringify해줄 것
function f(data, callback) {//,async
//data = {A: "valA", B: "valB"} 형태의 object
$.ajax({
url: model.getDataServiceURL("url"),
type: "POST",
contentType: "application/json",
data: JSON.stringify(data),
dataType: "josn",
async: false,
success: function(result){
callback(result);
},
error(xhr, status) {
callback({ result: "Fail", data: xhr.responseText });
},
})
}
'error' 카테고리의 다른 글
blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. (0) | 2023.05.25 |
---|---|
form.submit / spring 전송 에러 (0) | 2022.12.13 |
chrome 106 drag and drop error (0) | 2022.10.13 |
_focusTabbable 에러 (0) | 2022.07.23 |
[spring] required (error: parameter '' is not present) (0) | 2022.06.11 |