retrive data from firebase in an html table on click of a button

By vikas

How to retrieve data from firebase in an html table on click of a button? here is what i have tried.

var ref = database.ref('details');
ref.on("value", getData, errData);
function getData(data){
   var details = data.val();
   var keys = Object.keys(details);
console.log(keys);
for(var i=0; i<keys.length; i++){
    var k = keys[i];
    var PName = details[k].PName;
    var Assigned = details[k].Assigned;
    var SDate = details[k].SDate;
    var EDate = details[k].EDate;
    var Leader = details[k].Leader;
}

}

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273