mirror of
https://github.com/bvanroll/little_people_firebase.git
synced 2025-08-29 03:42:39 +00:00
working?
This commit is contained in:
75
public/index.html
Normal file
75
public/index.html
Normal file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Welcome to Firebase Hosting</title>
|
||||
|
||||
<!-- update the version number as needed -->
|
||||
<script defer src="/__/firebase/9.16.0/firebase-app-compat.js"></script>
|
||||
<!-- include only the Firebase features as you need -->
|
||||
<script defer src="/__/firebase/9.16.0/firebase-database-compat.js"></script>
|
||||
<script defer src="/__/firebase/9.16.0/firebase-storage-compat.js"></script>
|
||||
<!--
|
||||
initialize the SDK after all desired features are loaded, set useEmulator to false
|
||||
to avoid connecting the SDK to running emulators.
|
||||
-->
|
||||
<script defer src="/__/firebase/init.js?useEmulator=true"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="container" id="people">
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var statusItem = document.querySelector("p#status");
|
||||
var peopleList = document.querySelector("#people");
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
try {
|
||||
let app = firebase.app();
|
||||
let features = [
|
||||
'database',
|
||||
'storage'
|
||||
].filter(feature => typeof app[feature] === 'function');
|
||||
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
var database = firebase.database();
|
||||
var rootRef = database.ref('/');
|
||||
console.log(peopleList)
|
||||
rootRef.once('value', function(snapshot){
|
||||
snapshot.forEach(function(d) {
|
||||
var v = d.val();
|
||||
peopleList.innerHTML += `<div class="card">
|
||||
|
||||
<h5 class="card-header">${v.firstName} ${v.lastName}</h5>
|
||||
<h6>Gender:</h6>
|
||||
<p>${v.gender}</p>
|
||||
<h6>Age:</h6>
|
||||
<p>${v.age}</p>
|
||||
<h6>Current Country of Residence:</h6>
|
||||
<p>${v.country}</p>
|
||||
<h6>Job:</h3>
|
||||
<p>${v.job}</p>
|
||||
<h6>Bio:</h6>
|
||||
<p>${v.bio}</p>
|
||||
</div>`;
|
||||
console.log(d.val());
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user