I try to store some objects in my database but for some reason there's a problem with my function. I get the error named in the title.
//here is the Firebase config stuff
function writeData() {
firebase.database().ref("User").set({
name: document.getElementById("namefield").value,
age: document.getElementById("agefield").value
});
}
<h1>Test</h1>
<input type="text" placeholder="name" id="namefield">
<input type="text" placeholder="age" id="agefield">
<button onclick="writeData()">Submit</button>