This is how my html looks like
<!DOCTYPE html>
<html>
<head>
<title>Pet Article</title>
<script src="https://www.gstatic.com/firebasejs/5.5.8/firebase.js"></script>
</head>
<body>
<img src = "cat.jpg" width = 700px , height = "500px" />
<img src = "dog.jpg" width = 700px , height = "500px" />
<p>This is the paragraph <br /> Need more?</p>
<hr />
<h1 id="big0ne" ></h1>
<script>
// Initialize Firebase
var config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: ""
};
firebase.initializeApp(config);
var big0ne = document.getElementById('big0ne');
var dbRef = firebase.database().ref().child('text');
dbRef.on('value', snap => big0ne.innerText = snap.val());
</script>
</body>
</html>
I am a newbie in programming and this is the first time I would ask here so please bear with me.
We were asked to make a project using firebase database and connect it to our website to retrieve data. I have found tutorials on youtube and the internet, however i cant seem to find a tutorial that works on retrieving nested value on firebase. It returns the data as [object Object]
I would like to know how to retrieve nested data in firebase. I would attach the image of how my database looks like. heres my html code. I didnt make a separate javascript file. I just put the javascript code inside the "script" tag since it works anyways. I will purposely remove API keys, etc. for security reasons.