1
0
mirror of synced 2024-12-24 03:34:50 +01:00
bemaniutils/bemani/frontend/static/ajax.js

34 lines
904 B
JavaScript
Raw Normal View History

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);
}
},
});
},
};