I am creating a notifications feature on a website which tells the user they have some notifications that they should check, for example they have a reply to a comment that they wrote.
They can go to their notifications page and see a list of all of their notifications. Now I want to mark all of these notifications as read instead of as unread, but only if the user actually received my server's response. The solution I can think of is:
- writing some js code which when the page is loaded will send some ajax request and tell my server to mark all the notifications on the page to be marked as read
but I was wondering what are people's thoughts on this and if there is some good well known pattern. couldn't find a satisfactory answer.