Answer the question
In order to leave comments, you need to log in
Appearance of the text right after sending?
Guys all good night! Help me make such a thing, I don’t even know what it’s called, or at least links to such a topic :) In general, I have a one-page starter template that I wrote in 20 minutes. Html / css markup, in the header there is a button called "write", when you click on it, a modal window pops up, in the modal window a person writes his name and his text. So I need to do this: when a person clicks on the submit button, so that his text and his name are immediately on the site without refreshing the page. And so that other users, when they enter the site, also see, for example (reviews from other people). Like a feedback system, but without registration. I hope I made it clear.
Answer the question
In order to leave comments, you need to log in
The steps are something like this (assuming a frontend framework is used):
1. Feedback is sent via Ajax = the page is not reloaded. When a user submits a review, the server sends a 200 code and this same review if successful. Next, this review is inserted into a conditional array with reviews, and then this array with reviews is dynamically updated in HTML (like v-for in Vue).
2. In order for other people to see this review without reloading the page, there will be some kind of timer on the site that takes reviews from the server from time to time and compares them with those reviews that it has in the array. Well, this is a dumb method of course, but I haven’t come up with anything better yet.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question