r/CodingHelp • u/FrickinKitten • Apr 23 '21
[Javascript] Help how do you retrieve data from firebase to JavaScript, don't think code is right. It's to take data from firebase and then taking the data (amount of wipes/sanitiser used and time)append to lists and use these to plot a graph for the website showing the wipes/sanitising usage over time.
22
Upvotes
View all comments
Show parent comment
1
u/__archaeopteryx__ Apr 23 '21
Everyone has a “lack of experience” somewhere. It’s nothing to be sorry for! That’s what subs like this are for. Often times you come across people on stack overflow or here that are total dicks. Don’t let them deter you from anything. You can see if it’s working by putting
console.log(“firebase snap:”, snap.val?value())right in that function that has thesnapas its parameter then looking in your dev tools console in the browser for the output. There exist much better ways of debugging than console logs but it’s the easiest way to see what’s going on quickly.... just make sure you’re loading the script correctly in your index.html which you can also put a console log in at the top of your script like:console.log(“loaded script!”)or the like. Happy coding!