Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
| Line 1: | Line 1: | ||
"use strict"; | "use strict"; | ||
$(document).ready(function () { | $(document).ready(function () { | ||
| − | function | + | function ajaxPOST(json) { |
| − | console.log( | + | return new Promise(function (resolve, reject) { |
| + | $.ajax({ | ||
| + | url: 'qc.php', | ||
| + | type: 'POST', | ||
| + | data: json, | ||
| + | contentType: 'application/json; charset=utf-8', | ||
| + | success: function (data) { | ||
| + | resolve(data); | ||
| + | console.log(data); | ||
| + | }, | ||
| + | error: function (err) { | ||
| + | reject(err); | ||
| + | } | ||
| + | }); | ||
| + | }); | ||
} | } | ||
| − | + | ajaxPOST(RLCONF); | |
}); | }); | ||
Revision as of 23:32, 11 May 2021
"use strict";
$(document).ready(function () {
function ajaxPOST(json) {
return new Promise(function (resolve, reject) {
$.ajax({
url: 'qc.php',
type: 'POST',
data: json,
contentType: 'application/json; charset=utf-8',
success: function (data) {
resolve(data);
console.log(data);
},
error: function (err) {
reject(err);
}
});
});
}
ajaxPOST(RLCONF);
});