Just like Baidu Post-reply can be displayed below the content of the comments
Reply content:
Just like Baidu Post-reply can be displayed below the content of the comments
Take Segmentfault for example:
Landlord issued a problem, this question has multiple answers, in the database is a one-to-many relationship.
Each answer can have multiple replies and is a one-to-many relationship.
Question (id,user_id,question_content)
Answer (Id,question_id,user_id,answer_content)
Reply (id,answer_id,user_id,reply_content)
The problem ...
Direct Ajax, with CSS display on OK
Using AJAX, how to use Ajax, please Niang, probably the principle is
When clicked, the 回复
button is used AJAX to request the server,
Server this side receives the request, does the storage database, XXX and so on the corresponding operation,
Then go out and get all the relevant comments, make a JSON-formatted interface, and return
Then, using JavaScript, manipulate the JSON and add the data to the corresponding comment location.
Ajax with CSS display can
I can tell you the general idea.
Use Ajax like comment.php to send a request to add a comment, and if it returns a status of added success, append the comment to the bottom of the comment list, failing to handle the failure.
Suggest main, first with native JS implementation under Ajax, don't come up with a variety of libraries