-1

Here is the whole html and javascript code. After submiting also my firebase is not showing anydata plzz help....

Enter any number
enter e-mail
enter nick-name Submit
    <!-- The core Firebase JS SDK is always required and must be listed first -->
    <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-app.js"></script>

    <!-- TODO: Add SDKs for Firebase products that you want to use
    https://firebase.google.com/docs/web/setup#available-libraries -->
    <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-analytics.js"></script>

   <script>
     // Your web app's Firebase configuration
    var firebaseConfig = {
     apiKey: "AIzaSyALexu52pRX3m0nL92qSNcl9t2ohhIzAS4",
     authDomain: "just-demo-373a2.firebaseapp.com",
     databaseURL: "https://just-demo-373a2.firebaseio.com",
     projectId: "just-demo-373a2",
     storageBucket: "just-demo-373a2.appspot.com",
     messagingSenderId: "834837235468",
     appId: "1:834837235468:web:f3dbef999d51d15612ab29",
     measurementId: "G-FEJBSGENTD"
 };
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();

Here is the javascript.

  function button(){
  firebase.database().ref("user").set({
   userid:document.getElementById("userID").value,
   useremail:document.getElementById("email").value,
   username:document.getElementById("name").value 
 });


 }

what should I do?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
tony
  • 1
  • 1
  • The code looks fine at first glance, so you'll want to look at the JavaScript console of your browser for any error messages. The most common one is `permission denied`, which means the user is not allowed to write to the database as further explained here: https://stackoverflow.com/questions/37403747/firebase-permission-denied. – Frank van Puffelen Aug 04 '20 at 19:02

1 Answers1

0

I created a fiddle for this at: https://jsfiddle.net/raddevus/sqm3og1r/5/

When I click the Test button (I added) I see an error in the console that states:

firebase.database is not a function

Is that a valid call. The initialize seems to be running, but not that database call.

raddevus
  • 8,142
  • 7
  • 66
  • 87
  • As @raddevus pointed out, this could be what you're looking for https://stackoverflow.com/questions/55598993/firebase-database-ref-is-not-a-function-error – omegatrix Aug 04 '20 at 20:30