How can I make comments like on stackoverflow?
What I mean more specificly, I use php/mysql how would I add a comment without reloading the page, I know this is a simple process of using AJAX but when you post a comment on SO it also has the option to delete it right away, when I insert comments into my DB there ID number is auto increment, so my real question now is
After posting the comment, is the comment posted, just added to the page with some javascript to append the contents to the page
OR
Does it use AJAX to retrieve that comment you just posted and then display it on the page?
The reason I am wondering is because since my system uses auto increment ID then if I did it the first method which would be faster to just ad the contents I posted on submit but this method would not give me the ID which is needed to be able to delete the comment by ID number
Hope that makes sense
UPDATE I posted below what I think now after reading other post on here