how to execute something after ajax call
BY LOVE,
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');
}
});
Also in JavaScript:
- passing data variable using ajax
- Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.ts(1219) angular
- js get base url
- angularjs accordion access toggle
- are you sure you want to proceed click ok button javascript code
- align text center react native
- expo app.json
- odoo submit form using js and display data
- arrow function javascript
- react native text input next field hooks focus
- samesite cookie nodejs
- javascript Count the frequency of a value in an array
- react Refused to execute inline script because it violates the following Content Security Policy directive
- ad data to js object
- node js return json
- Javascript string compression
- angular bind to class or ngClass
- The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object. scoop
- js export multiple functions
- get number of creeps screeps
- remove square brackets from string javascript
- content editable vuejs
- react-google-maps satelite
- javascript regex Zero or one occurrence