llms-ajax.js 477 Bytes
Newer Older
cyrille's avatar
cyrille committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
function Ajax (type, data, cache) {

	this.type     = type;
	this.data     = data;
	this.cache    = cache;
	this.dataType = 'json';
	this.url      = window.ajaxurl || window.llms.ajaxurl;

}

Ajax.prototype.check_voucher_duplicate = function () {

	jQuery.ajax({
		type 		: this.type,
		url			: this.url,
		data 		: this.data,
		cache		: this.cache,
		dataType	: this.dataType,
		success		: function(response) {
			llms_on_voucher_duplicate( response.duplicates );
		}
	});
};