20 lines
449 B
JavaScript
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('');
|
|
}
|
|
}
|
|
);
|
|
}; |