html – how can I retrieve data from Firebase in web using javascript?-ThrowExceptions

Exception or error:

How can I retrieve data from Firebase and add to html page?
and, How can I open new html pages automatically to add the data I was retrieving it?
I have this course from firbase:

this key I was pushing it .
and I want my website like this course :
courses image

When I click this courses I want to see all data about this course like this :
description coursers

Can anyone help me ?!
I won’t like this style just I want to know how can i retrieve data and add it in new html pages in the same style in all courses .

How to solve:

You can retrieve data from a firebase realtime database like so:

// Import Admin SDK
var admin = require("firebase-admin");

// Get a database reference to our posts
var db = admin.database();
var ref = db.ref("path/of/your/information");

// Attach an asynchronous callback to read the data at our posts reference
ref.on("value", function(snapshot) {
}, function (errorObject) {
  console.log("The read failed: " + errorObject.code);

See Official Documentation here

Note: requires Node.js / npm

Leave a Reply

Your email address will not be published. Required fields are marked *