-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivity.js
More file actions
56 lines (47 loc) · 1.38 KB
/
activity.js
File metadata and controls
56 lines (47 loc) · 1.38 KB
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
/*
File Name : activity.js
File Path : C:\xampp\htdocs\phpCRUD
Description : Javascript page which makes an AJAX call whenever user performs any activity.
Created date : 04/02/2019
Author : Mukesh
*/
var activity = (function() {
$( "table tbody" ).on( "click", "#b_Update", function(){
var id = $(this).closest('tr').find('td:eq(0)').text();
var email = $(this).closest('tr').find('td:eq(3)').text();
var activity = "Edited content";
$.ajax
({
type: "POST",
url: "activitytrack.php",
data:{
'id' : id,
'email': email,
'activity': activity
},
error: function(){
alert("Error");
}
});
});
$( "table tbody" ).on( "click", "#b_Del", function(){
var id = $(this).closest('tr').find('td:eq(0)').text();
var email = $(this).closest('tr').find('td:eq(3)').text();
var activity = "Deleted content";
$.ajax({
type: "POST",
url: "activitytrack.php",
data: {
'id': id,
'email': email,
'activity': activity
},
error: function(msg)
{
alert(msg);
}
});
});
return{
}
})();