cb2004 Posted February 23, 2024 Posted February 23, 2024 Hi all. My JS/jQuery really struggles towards the end of the week, but I was just wondering if anybody has had the need to check the modified date of a page and if there is new to refresh. If not I will take a stab at it again next week. Have a good weekend all.
wbmnfktr Posted February 23, 2024 Posted February 23, 2024 Like a newsticker or newsfeed that updates whenever there is a new post? I will need something of that kind in a project very soon and looked at a solution with HTMX using polling or SSE. While looking into it I stumbled across something an old thread here: Haven't had the time to dig deeper but maybe this is good starting point for you.
cb2004 Posted March 14, 2024 Author Posted March 14, 2024 I was thinking maybe it could be a bit simpler, for me all I need to do is check the modified date every 5 seconds and if it is different to what the page currently says then it just refreshes.
wbmnfktr Posted March 14, 2024 Posted March 14, 2024 I use htmx polling for that in a monitoring widget. It's only visible for superusers so that was the easiest way. Don't know if this would actually fit your use case at all.
da² Posted March 14, 2024 Posted March 14, 2024 3 hours ago, cb2004 said: I was thinking maybe it could be a bit simpler If you don't want to add a library, why not using a simple XHR? That's only a few line of JS and PHP. On what part are you struggling exactly? 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now