Hurry! How to monitor the value change of the page?

1. Requirements: the page first renders a pile of data (old values), then returns changed data (new values) every 3 seconds, and re-renders the corresponding data on the page (the old values will be overwritten by new values).
2. Problem: if the newly returned value is greater than the old value, an upward arrow appears and disappears after 5 seconds; otherwise, the arrow is down;
3. There are thousands of values on the page. The new values that change every 3 seconds will not return too many, ranging from 20 to 1.
from thunderspeed network click to jump


WebSocket and vue are recommended. Websocket is used to push returned data from the server, with new and old values each time ({old:0.833,now:0.855}), vue can be used for data binding. There is no need to operate dom, to add corresponding class


if the updated data is requested at fixed intervals, of course, use polling . If the backend pushes data actively, of course, use websocket . As for how the page is rendered, it depends on what framework you use, react , vue is fine.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e58b41-43a80.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e58b41-43a80.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?