Page 546 - MDP2022-3
P. 546
})
}).done(function (res) {
$("#title").val('');
$("#date").val('');
window.location = '/';
});
}
function doneTodo(todo_id) {
$.ajax({
url: '/api/v1/todos',
contentType: 'application/json',
method: 'PUT',
data: JSON.stringify({
todo_id: todo_id
})
}).done(function (res) {
window.location = '/';
});
}
function deleteTodo(todo_id) {
$.ajax({
url: '/api/v1/todos',
contentType: 'application/json',
method: 'DELETE',
data: JSON.stringify({
todo_id: todo_id
})
}).done(function (res) {
window.location = '/';
});
}
</script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container px-lg-5">
<a class="navbar-brand" href="/">OSD</a>
<div style="color:white; text-align: center;">
{%if userid%}
{{userid}}님 환영합니다!
{%endif%}
</div>