Skip to content

Instantly share code, notes, and snippets.

@ZhenDeng ZhenDeng/Ajax sample
Last active Jan 20, 2019

Embed
What would you like to do?
$.ajax({
url: '/Account/Login',
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify(loginInfo),
dataType: 'json',
success: function (output) {
if (output.Status == 'fail') {
hideProgress();
$('#btnLogin').hideProgress();
$('#btnLogin').showValidator(output.Message, 'error', msgPosition, true);
$('#btnLogin').html(loginText);
}
else {
$('#btnLogin').html('Authenticated');
if (window.location.search.substr(0, 11) == '?ReturnUrl=') {
window.location = decodeURIComponent(window.location.search.slice(11));
}
else
window.location.reload();
}
},
error: function (request, status, error) {
hideProgress();
$('#btnLogin').hideProgress();
$('#btnLogin').html(loginText);
$('#btnLogin').showValidator(error, 'error', msgPosition, true);
}
});
$.ajax({
type: "GET",
url: 'api/Checkout/GetPartnerByMPNId?mpnId=' + mpnId,
async: false,
success: function (data) {
if (data.result != 'Success') {
$('#tenant_next').showValidator(data.info, 'error');
isValid = false;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.