仅显示自上次访问以来更新的文件单击后删除标记
我有一个经常更新的 .html 文件列表。
我正在寻找最好的方法来通过向
添加一个类来显示自用户上次访问以来它们已更新。目前,我正在为 lastVisit
放置一个具有相关日期/时间的 cookie,并且可以通过将文件更改时间与 lastVisit
中的时间进行比较来显示已更新的文件。曲奇饼。
一旦用户单击查看其中一个文件并返回到列表,所有“已更新”标志都会被重置(因为 cookie 会使用当前日期/时间进行更新),因此看起来好像没有已更新。
有没有办法在他们访问实际页面时显示更新的状态并删除更新的标志,但保留其余部分显示?
方法&目前我无法理解逻辑。
任何帮助将不胜感激。
I have a list of .html files that are updated every so often.
I am looking for the best way to show that they have been updated since the user's last visit by adding a class to the <li>
.
Currently I am dropping a cookie for lastVisit
with the relevant date / time and can show the files that have been updated by comparing the time the file was changed to the lastVisit
in the cookie.
As soon as the user clicks to view one of the files and returns to the list though, all of the 'updated' flags have been reset (as a the cookie is updated with the current date / time) so it looks as if none are updated.
Is there a way to show the updated state and remove the updated flag when they have visited the actual page but leave the rest showing?
The method & logic currently escape me.
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论