-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript-2.js
More file actions
21 lines (21 loc) · 913 Bytes
/
script-2.js
File metadata and controls
21 lines (21 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$(document).ready(function(){
$.getJSON('notification.json', function(data) {
alert("notification.json");
var arrayLength = Object.keys(data.notifications.notification).length;
var htmlData = "<table><tr><th>NOTIFICATION</th></tr>"
for(var i=0; i<arrayLength; i++){
htmlData = htmlData + "<tr><td><p>" + data.notifications.notification[i].notify + "</p><p>" +
data.notifications.notification[i].Overdue + "</p></td>" + "<td><button>View</button></td></tr>";
}
htmlData = htmlData + "</table>";
console.log(htmlData);
$("div.events-three").html(htmlData);
$("table").addClass("tableClass");
$("th").addClass("thTd");
$("th").addClass("headerText");
$("td").addClass("thTd");
$("button").addClass("btn btn-info");
$("tr>td:first-child>p:first-child").addClass("Bold");
$("tr>td:first-child>p:nth-child(2)").addClass("Italics");
});
});