Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

306
Views
Cómo arreglar el método push de Firebase Realtime Database v9

Creé un archivo HTML test.html , pero después de enviarlo, no muestra ningún dato. Estoy haciendo algo mal, por favor ayúdame.

Estoy usando Firebase Realtime Database v9

CÓDIGO

 <html> <head> <script type="module"> import { initializeApp } from 'firebase/app'; import { getDatabase } from "firebase/database"; const firebaseConfig = { apiKey: "*", authDomain: "*.firebaseapp.com", databaseURL: "https://*.firebaseio.com", storageBucket: "*.appspot.com" }; const app = initializeApp(firebaseConfig); const database = getDatabase(app); import { getDatabase, ref, push } from "firebase/database"; function writeMessageData() { const db = getDatabase(); set(ref(db, 'data/'), { name: document.getElementById("feildName").value, msg: document.getElementById("feildMessage").value }); } </script> <title>Test</title> </head> <body> <input type="text" id="feildName" placeholder="Name"> <input type="text" id="feildMessage" placeholder="Message"> <button id="btnSubmit" onclick="writeMessageData()">SEND</button> </body> </html>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Haz que tu función sea asíncrona

 async function writeMessageData() { await set(ref(db,'ThePath'),{ name: document.getElementById("feildName").value, msg: document.getElementById("feildMessage").value }).then((success) => {console.log(success)}).catch((err) => {console.log(err)}) }
  1. también verifique las reglas de la base de datos que ha establecido.
  2. intente quitar la barra. cambiar la ruta de "data/" a "data"

sobre todo debería funcionar buena suerte.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!