简体   繁体   English

通过Firebase数据库将实时数据显示到网页上

[英]Display real-time data to a web page through Firebase Database

I am using Firebase Realtime Database to store some data and i also have a website that is showing/changing an image src according to a data change. 我正在使用Firebase Realtime数据库存储一些数据,并且我还有一个网站根据数据更改显示/更改图像src。

I have written a javascipt that is changing the html image source whenever a data is triggered from Firebase but i would like that to work at the backend. 我已经编写了一个javascipt,每当从Firebase触发数据时,它都会更改html图像源,但是我希望它可以在后端工作。 I want that image to change even if no one visits the site. 我希望即使没有人访问该站点,该图像也要更改。 How can i do that? 我怎样才能做到这一点?

You will need to preserve on a state. 您将需要保留一个状态。

For example, create some database that saved on every user his current "step", and your frontend app will query this database. 例如,创建一个数据库,该数据库保存在每个用户的当前“步骤”上,您的前端应用程序将查询该数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM