-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyHelpFile.js
More file actions
67 lines (43 loc) · 1.82 KB
/
myHelpFile.js
File metadata and controls
67 lines (43 loc) · 1.82 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
57
58
59
60
61
62
63
64
65
66
67
// Examples from Firebase
// Methods https://firebase.google.com/docs/reference/js/firebase.database.Reference.html#methods
//********************
// SET * https://firebase.google.com/docs/reference/js/firebase.database.Reference.html#set
//********************
var adaNameRef = firebase.database().ref('users/ada/name');
adaNameRef.child('first').set('Ada');
adaNameRef.child('last').set('Lovelace');
// We've written 'Ada' to the Database location storing Ada's first name,
// and 'Lovelace' to the location storing her last name.
adaNameRef.set({ first: 'Ada', last: 'Lovelace' });
// Exact same effect as the previous example, except we've written
// Ada's first and last name simultaneously.
adaNameRef.set({ first: 'Ada', last: 'Lovelace' })
.then(function() {
console.log('Synchronization succeeded');
})
.catch(function(error) {
console.log('Synchronization failed');
});
// Same as the previous example, except we will also log a message
// when the data has finished synchronizing.
//********************
// PUSH * https://firebase.google.com/docs/reference/js/firebase.database.Reference.html#push
//********************
//********************
// REMOVE * https://firebase.google.com/docs/reference/js/firebase.database.Reference.html#remove
//********************
var adaRef = firebase.database().ref('users/ada');
adaRef.remove()
.then(function() {
console.log("Remove succeeded.")
})
.catch(function(error) {
console.log("Remove failed: " + error.message)
});
// in my case
var ref = firebase.database().ref('Learning/-Lv_nfqdwVpBwM6yWtWh');
ref.remove();
// DOM element SELECT
var mySelect = document.getElementById('keysfrm3');
var selValue = mySelect.options[mySelect.selectedIndex].value;
console.log(selValue);