Is there any difference between $.post and $.ajax methods in jQuery
$.post("/SPA/Main/SaveEmployee", e).then({
//code
});
and
$.ajax({
url: "/Spa/SpaBulkUpload/Upload",
type: 'POST',
contentType: false,
processData: false,
data: fd
}).then(function (e) {
//Code
});
The post
method is a shorthand method for ajax
with type of "POST"
as stated in the jQuery documentation. But, you do still need to specify everything else except the type property.
$.post({
url: "/Spa/SpaBulkUpload/Upload",
contentType: false,
processData: false,
data: fd
}).then(function (e) {
//Code
});
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments