thắc mắc [Firebase to Web] Mọi người cho em hỏi về cách lấy dữ liệu từ database để xuất ra web với ạ

antiquaden

Junior Member
Em đang làm 1 cái project đo dữ liệu từ arduino là gửi lên database của firebase,
Bây giờ chỉ còn cái hiển thị dữ liệu realtime là bị lỗi. Em mới tập tành lập trình web nên mọi người giúp em xem lỗi này là như nào vậy ạ.
Em cần biết cái hàm có thể lấy dữ liệu từ database của firebase nhưng nó cứ báo lỗi firebase.database() is not a funtion
Mọi người cho em xin tham khảo cái vấn đề liên quan ở chỗ firebase với ạ. Cảm ơn MN.
 
Last edited:
Theo như document thì nó ghi thế này
<body>
<!-- Insert these scripts at the bottom of the HTML, but before you use any Firebase services -->
Bạn đang để ở header.
Version firebase đang ở nhiều version khác nhau lúc 7 lúc 6 lúc 4. Đặt biệt file firebase.js là file full sdk đang là 4 nhưng file firebase app lại là 7.
Tham khảo
<body>
<!-- Insert these scripts at the bottom of the HTML, but before you use any Firebase services -->

<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
<script src="/__/firebase/7.14.6/firebase-app.js"></script>

<!-- If you enabled Analytics in your project, add the Firebase SDK for Analytics -->
<script src="/__/firebase/7.14.6/firebase-analytics.js"></script>

<!-- Add Firebase products that you want to use -->
<script src="/__/firebase/7.14.6/firebase-auth.js"></script>
<script src="/__/firebase/7.14.6/firebase-firestore.js"></script>
</body>
Link tham khảo
https://firebase.google.com/docs/we...TbDNDa0s5JFiBRCjXJAqCpZjmvdl894xoCcIIQAvD_BwE

Mình thấy bạn không sử dụng firebase-auth.js và analytics thì có thể bỏ ra luôn
 
Last edited:
image.png
 
Bác ơi cho em hỏi bác còn giữ code ko ạ.em cũng vừa tập tành cái này và bị lỗi y như bác.em chẳng hiểu lập trình web lắm copy theo ngta thôi mà gặp lỗi đó.please help me
 
Back
Top