AspNetCore.Docs/aspnetcore/includes/add-javascript-jquery/samples/sample5.js

20 lines
449 B
JavaScript

function addItem() {
var item = {
'name': $('#add-name').val(),
'isComplete': false
};
$.ajax(
{
type: "post",
accepts: "application/json",
url: uri,
contentType: "application/json",
data: JSON.stringify(item),
success: function (result) {
getData();
$('#add-name').val('');
}
}
);
};