到目前为止,这是我的代码(经过多次迭代,没有任何效果) 我试图让患者发送电子邮件并将其显示在我的html网页上。
理想情况下,我试图使数据以html形式显示,但我现在只是使用警报来使其显示。
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyAJzJubsXxt0LaXArXTqReJPc29EEibg9w",authDomain: "medapp-f2621.firebaseapp.com",databaseURL: "https://medapp-f2621.firebaseio.com",projectId: "medapp-f2621",storageBucket: "medapp-f2621.appspot.com",messagingSenderId: "655222508631",appId: "1:655222508631:web:98c905fa1905a1f22f6712",measurementId: "G-927SW3SCE0"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
var patientsref = firebase.database().ref("patients");
patientsref.on("value",function(snapshot) {
snapshot.forEach(function(childsnapshot) {
var childData = childsnapshot.val();
var email=childData.email;
window.alert(email);
});
});
</script>
这是数据库 database