-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathfirebase.js
More file actions
27 lines (24 loc) · 886 Bytes
/
firebase.js
File metadata and controls
27 lines (24 loc) · 886 Bytes
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
(function() {
const config = {
//YOUR CONFIGS
};
firebase.initializeApp(config);
const bigTextEvaluationStudents = document.getElementById('bigTextEvaluationStudents');
const dbBigTextEvaluationStudentsRef = firebase.database().ref().child('bigTextEvaluationStudents');
dbBigTextEvaluationStudentsRef.on('value', snap => bigTextEvaluationStudents.innerText = snap.val());
var table = document.querySelector('#table1 tbody');
const dbEvaluationStudentsRef = firebase.database().ref().child('evaluationStudents');
dbEvaluationStudentsRef.on('value', snap => {
while(table.hasChildNodes()) {
table.removeChild(table.firstChild);
}
var students = snap.val();
for(var i in students) {
var row = table.insertRow(-1);
for(var j in students[i]) {
cell = row.insertCell(-1);
cell.innerHTML = students[i][j];
}
}
});
}());