-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
126 lines (107 loc) · 2.18 KB
/
main.js
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
$("#view").hide();
$(".completedtask").click(function(){
$("#view").toggle();
});
/*$(".completedtask").click(function(){
$.ajax({
//type: "POST",
url: "compleatedtask.php",
//data: {sname : ""},
cache: false,
success: function(data){
alert(data);
}
});
});*/
/*$("#submit").click(function(){
alert("working");
data = {};
$(document).find("[name]").each(function(index,value){
var that = $(this);
var name = that.attr("name");
var value = that.val();
data[name] = value;
});
$.ajax({
url = "head.php",
type = "get",
data = data,
sucess:function(response){
$("#error").innerHTML = response;
}
});
});*/
/*$('#submit').on('click',function(){
//alert("hai")
var that = $(document),
data={};
var ename = $("#name").val();
var epassword = $("#password").val();
//alert(ename + epassword);
data["name"]=ename;
data["password"]=epassword;*/
/*that.find('[name]').each(function(index,value){
var that=$(this);
name =that.attr('name'),
value = that.val(),
data[name]=value;
});*/
/*$.ajax({
url:"head.php",
type:"post",
data:data,
success:function(response){
console.log(response);
document.getElementById('error').innerHTML = response;
}
});
return false;
});*/
$("#view_edit").hide();
$(".alltask").click(function(){
//alert("dgdg");
$("#view_edit").toggle();
});
$("#changetask").click(function(){
var task = $("#task").val();
alert(task);
});
$("button").click(function(){
//alert("ypppp");
var me = $(this).attr('class');
//alert(me);
if(me!="alltask"&&me!="completedtask"){
//alert(me);
//alert("ypppp");
var id = '#'+me;
var work = $(id).val();
//alert(work);
//var head = $("input[name = me]").val();
//alert(head);
//alert(work);
$.ajax({
type: "POST",
url: "delete.php",
data: {sname : me , task : work},
cache: false,
success: function(data){
//alert(data);
window.location.replace("home.php");
}
});
}
//alert(me);
});
/*$("a").click(function(){
var name = $(this).attr('class');
//alert(name);
$.ajax({
type: "POST",
url: "delete.php",
data: {sname : name},
cache: false,
success: function(data){
//alert(data);
}
});
});*/