Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
function writeUserData() {
            document.getElementById("demo").style.backgroundColor = "lightgreen";
            firebase.database().ref('users').set({
                username: document.getElementById("namef").value,
                yas: document.getElementById("yasf").value,

            });
        }


my code is this.

I changed the rules but,ı think ı cannot database permissions set true...

What I have tried:

I tried change permissions as true, different functions.Creating a website in HTML/JS that stores data in Firebase! - YouTube[^] tried all in this video.
Posted
Updated 17-Aug-20 2:59am
v2

1 solution

Here, have a look here:
Firebase CRUD Web App with Javascript 🔥 – Part 1 Get/Read Data | SoftAuthor[^]

1. Go to Firebase Console.
2. Go to DEVELOP → Database → Get Started → RULES Tab.
3. Change read and write properties to true.
4. Hit PUBLISH.
JavaScript
{
  "rules": {
      ".read" : true,
      ".write": true
   }
}
 
Share this answer
 
Comments
Member 14916183 17-Aug-20 8:45am    
ı already did it, and ı disappointed after that, ı change the rules, but it still doenst work.function writeUserData() {
document.getElementById("demo").style.backgroundColor = "lightgreen";
firebase.database().ref('users').set({
username: document.getElementById("namef").value,
yas: document.getElementById("yasf").value,

});
}

here's my function.
I appointed for button, but there is no action in firebase.
I have no idea what should ı do more...
Sandeep Mewara 17-Aug-20 8:48am    
Post changing, did you publish your firebase with changes?
Member 14916183 17-Aug-20 8:56am    
{ "rules": {
".read": true,
".write": true

}
}

Yes,ı publish as this.
then after ,ı create new account change database type , there was 2 mode: locked mode, test mode, ı tried both. I tried different permissions type ( for, maybe servers dont allow set it true. I really tried. There is no action on database.
I use set() and push() function. I cannot handle it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900