Reputation: 584
I have a database with a lot of similar tables, and I have a program that will update the existing tables.
I also have a flask project which displays those tables. My final goal is to make the Flask app change the information on the open page without the user having to reload it. I have figured out how to do so, but I now need to know when a table has been updated.
How do I do that?
Upvotes: 0
Views: 839
Reputation: 1318
Approach 1: You can use ajax to reload the content in the table at a regular interval.
setTimeout(function,milliseconds)
setInterval(function, milliseconds)
Use any one of the Javascript function to fire the ajax at each interval.
Approach 2: Add this tag inside HTML head tag. It will refresh the page automatically,
<meta http-equiv="refresh" content="30">
Approach 3:
If you don't want to refresh the page, or don't want to use ajax, then you can try socket
. In this way, we can create our page to change whenever there is a change in the database. (like Chat App)
Upvotes: 1