In general, I'm completely confused ...
I try to make the chat so that the messages in it are updated as soon as a new line appears in the MySQL table ... At first I wanted to do it with long polling , but with active chat and large network delays ("big ping"), the delays are already more noticeable. Long polls (long poll)
What is better to use?
Then I wanted to on Server-Sent Events , but I need my own server for them, like I didn’t understand anything there in principle ...
Creating real-time applications using Server-Sent Events
There was only one WebSockets but here again I did not understand anything at all ...
Creating real-time applications using Server-Sent Events
In general, there is a code:
<div id="messeges"> </div> It should be updated posts.
MySQL chat table
`user_id` `text` What should be the code for the update?
div#messages. With this to freelance. Here people ask questions. - xEdelweiss