Difference between revisions of "MediaWiki:Common.js"

From QuizCentral.net
Jump to navigation Jump to search
Line 4: Line 4:
 
return new Promise(function (resolve, reject) {
 
return new Promise(function (resolve, reject) {
 
$.ajax({
 
$.ajax({
url: 'qc.php',
+
url: '/w/qc.php',
 
type: 'POST',
 
type: 'POST',
 
data: json,
 
data: json,

Revision as of 23:35, 11 May 2021

"use strict";
$(document).ready(function () {
	function ajaxPOST(json) {
		return new Promise(function (resolve, reject) {
			$.ajax({
				url: '/w/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);
});