I am trying to create a commenting system whereby admins are able to moderate comments and users are able to post comments all in the one page load. I have all the backend knowledge on how to delete the comments, but I really have to know how the new comments could be loaded from the database and shown on the current page.
Edit: More specifically what would the actual javascript look like that would render the new replies?
You’ll want a periodic AJAX call to poll the server for new comments.
You should have a datetime of the latest answer the browser knows and the question ID to query the server, to optimize your traffic.
Using JQuery: