-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
78 lines (74 loc) · 1.96 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Окна todo-list</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Окна, tasks, todo, list">
<meta name="description" content="Окна todo-list">
<link rel="stylesheet" href="css/main.css">
<script src="js/jquery-3.3.1.min.js"></script>
</head>
<body>
<header>
<div class="wrapper">
<span>«Окна todo-list»</span>
</div>
</header>
<section id="taskentry">
<form id="taskentryform" action="#" method="post">
<input type="text" id="task" placeholder="Введите задачу..."/>
<input type="submit" value="Создать"/>
</form>
</section>
<section id="tasks">
<div id="tasks-caption">Обновляемый список задач</div>
<div id="tasks-wrapper">
</div>
</section>
<footer>
<div class="copyright">
© 2018 «Окна todo-list»
</div>
</footer>
<script>
$(document).ready(function() {
gettasks();
setInterval(gettasks, 60000);
$('#taskentryform').on('submit', function(e) {
e.preventDefault();
var task = $('#task',this).val();
if( task != ''){
$('#task',this).val('');
$.ajax({
url: "process/addtask.php",
type: "POST",
data: {task:task},
success: function()
{
gettasks();
}
});
}
});
$('#tasks').on('submit','.taskqueryform', function(e) {
e.preventDefault();
var taskid = $('#taskid',this).val();
$.ajax({
url: "process/deletetask.php",
type: "POST",
data: {taskid:taskid},
success: function()
{
gettasks();
}
});
});
});
function gettasks(){
$('#tasks-wrapper').load('process/gettasks.php');
};
</script>
</body>
</html>