Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

332
Vistas
How do I fetch the value from a key in firebase using javascript

See the image i want to fetch this value in javascript

 var dbImages = firebase.database().ref("images");

 dbImages.on("value", function(images){

    if(images.exists()){
        var imageshtml = ""; 
        images.forEach(function(fetchImages){

             console.log("key: " + fetchImages.key);
             console.log("title: " + fetchImages.title);
             console.log("url: " + fetchImages.url);

        });
     }

});

Its only showing key value not other value i want to view key value and also the value of key value please help guys

This is the output of my javascript

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are using forEach() and DataSnapshot of /orders node where each child node seems to be a category and not the image itself. You'll have to loop over each image of the categories to list them:

firebase.database().ref("images").once("value").then((imagesCategories) => {
  if (imagesCategories.exists()) {
    var imageshtml = "";

    // For each category
    imagesCategories.forEach(function(categoryImages) {
      // For each category image
      categoryImages.forEach(function(image) {
        // Append data to imageshtml from here
        console.log(image.val().url)
        console.log(image.val().title)
      })
    })
  }
});
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda