-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
74 lines (34 loc) · 1.48 KB
/
script.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
var size = '200px';
var container = document.getElementById("container");
var greeting = document.createTextNode('Awaiting Words of Wisdom...');
document.body.insertBefore(greeting, container);
//container.style.width = "1200px";
//container.style.height = size;
//container.style.margin = "0 auto";
for (i = 0; i < 5; i++) {
var rankTextNode = document.createTextNode("Rank: ");
//rankTextNode.className = 'rankTextNode';
var statusTextNode = document.createTextNode('Status: Pending');
//statusTextNode.className = 'statusTextNode';
var div = document.createElement("div");
div.appendChild(rankTextNode);
div.appendChild(document.createElement('br'));
div.appendChild(statusTextNode);
div.appendChild(document.createElement('br'));
div.className = 'box'
//append styled div and its contents to container
container.appendChild(div);
}
var arrayOfBoxes = document.getElementsByClassName("box");
let num = 0;
services.forEach(service => {
service().then((value) => {
var i = arrayOfBoxes[num];
let rank = num + 1;
i.childNodes[0].nodeValue = 'Rank: ' + rank;
i.childNodes[2].nodeValue = 'Status: Resolved';
var wordsOfWisdom = document.createTextNode(value);
i.appendChild(wordsOfWisdom);
num++;
});
})