Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <div id="naam">
- <h1 id="foto" > </h1>
- <input id="input">
- </div>
- <!-- The core Firebase JS SDK is always required and must be listed first -->
- <script src="https://www.gstatic.com/firebasejs/6.0.2/firebase.js"></script>
- <!-- TODO: Add SDKs for Firebase products that you want to use
- https://firebase.google.com/docs/web/setup#config-web-app -->
- <script>
- // Your web app's Firebase configuration
- var firebaseConfig = {
- apiKey: "AIzaSyBSKDFrpzH20cORRQXl4JCRMZGMQEdvdfc",
- authDomain: "eatandmeet-d40ab.firebaseapp.com",
- databaseURL: "https://eatandmeet-d40ab.firebaseio.com",
- projectId: "eatandmeet-d40ab",
- storageBucket: "eatandmeet-d40ab.appspot.com",
- messagingSenderId: "164430662456",
- appId: "1:164430662456:web:d0bd9fc70de7a7cb"
- };
- // Initialize Firebase
- firebase.initializeApp(firebaseConfig);
- console.log(firebase)
- // Get a reference to the database service
- var database = firebase.database();
- </script>
- <script type="text/javascript">
- var userRef = database.ref("users/arjan/naam")
- var waarde
- userRef.on('value', function(snapshot) {
- document.getElementById("foto").innerHTML = snapshot.val();
- });
- function writeText(){
- userRef.set(document.getElementById("input").value)
- }
- console.log(waarde);
- document.getElementById("input").onkeyup = writeText
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement