Untitled
unknown
javascript
a year ago
964 B
17
Indexable
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
action: 'vamtam-check-license',
'license-key': $licenseInput.val(),
nonce: self.attr('data-nonce'),
unregister: isUnregister ? true : true,
},
success: function(data) {
if ( data.includes( 'Valid Purchase Key' ) ) {
window.location = window.location.href;
} else if ( data.includes( 'Incorrect Purchase Key' ) ) {
if ( isUnregister ) {
window.location = window.location.href;
} else {
$invalidMsg.css('display', 'flex');
self.removeClass('disabled');
$licenseInput.prop('enabled', true);
spinner.hide();
}
} else if ( data.includes( 'Unregistered Key' ) ) {
window.location = window.location.href;
} else {
result.append( $('<p />').addClass('vamtam-check-license-response').append(data) );
spinner.hide();
self.removeClass('disabled');
$licenseInput.prop('disabled', false);
}
}
});
});Editor is loading...
Leave a Comment