$.ajax({
url:'your url',
type: 'POST', // http method
data: { myData: 'This is my data.' }, // data to submit
success: function (data, status, xhr) { // after success your get data
$('p').append('status: '+ status +', data: '+ data);
},
error: function (jqXhr, textStatus, errorMessage) { // if any error come then
$('p').append('Error'+ errorMessage);
}
});
Posted by: Guest
on October-17-2020
0
how to show a success message when ajax called successfully
BYLOVE,
1-"beforeSend" event used to execute something before ajax call
2-"complete" event used to execute something after the ajax called successfull.
$.ajax({
url: ' @Url.Action("AttendanceUpdateLate", "Attendance")',
data: { Emp: $("#txtEmpid").val(), Status: $("#ddlAttendance").val(), day: $("#ddlday").val(), Month: $("#Month").val() },
datatype: "json",
type: "POST",
contenttype: 'application/json; charset=utf-8',
async: true,
success: function (data) {
alert(data);
},
beforeSend: function () {
alert("Alert showing before AJAX call");
},
complete: function () {
alert("Alert showing after AJAX call successfully");
$("#txtEmpid").val('');
$("#ddlday").val('');
$("#ddlAttendance").val('');
},
error: function (xhr) {
alert('error occured');
}
});
Posted by: Guest
on August-27-2020
Code answers related to "jquery ajax success function"
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems
resetting your password contact us
Check Your Email and Click on the link sent to your email