cb2004 Posted February 23 Share Posted February 23 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. Link to comment Share on other sites More sharing options...
wbmnfktr Posted February 23 Share Posted February 23 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. Link to comment Share on other sites More sharing options...
cb2004 Posted March 14 Author Share Posted March 14 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. Link to comment Share on other sites More sharing options...
wbmnfktr Posted March 14 Share Posted March 14 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. Link to comment Share on other sites More sharing options...
da² Posted March 14 Share Posted March 14 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 Link to comment Share on other sites More sharing options...
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