Is it possible to update the previous page's DOM/state using core JavaScript?
I'm creating a Reddit style social network as a final course project with Laravel and core JavaScript (no framework).
I'm using async fetch requests and Dom manipulation for actions like like/dislike/delete so the page doesn't refresh or goes back to the top.
On the posts index page, when a delete request succeeds, I remove the .postCard from the Dom.
But here's the problem:
If I'm inside the post show page (/posts/1), delete the post there, and then press the browser back button, the deleted post still appears on the previous page until refresh.
How should I handle updating the previous page's DOM/state in this situation using core JavaScript?
Is there a standard approach for this without using a frontend framework?