1
0
mirror of synced 2024-11-15 02:17:36 +01:00
bemaniutils/bemani/frontend/static/ajax.js
2019-12-08 21:43:49 +00:00

34 lines
904 B
JavaScript

var AJAX = {
get: function(url, resp) {
$.ajax({
dataType: "json",
contentType: "application/json; charset=utf-8",
url: url,
success: function(response) {
if (response.error) {
Messages.error(response.message);
} else {
resp(response);
}
},
});
},
post: function(url, data, resp) {
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json; charset=utf-8",
url: url,
data: JSON.stringify(data),
success: function(response) {
if (response.error) {
Messages.error(response.message);
} else {
resp(response);
}
},
});
},
};