Answer the question
In order to leave comments, you need to log in
Creating a consultant for the site?
Tell me how to implement a similar window for the site:
I need to enter some keyword, the data is sent to the server and a selection is made there, and the response from the server appears in the same window. You need to do at least something simple)), tell me how to do it all, or maybe there are ready-made examples?
Answer the question
In order to leave comments, you need to log in
If we omit all the details about the chat window, then only the form input and the send button remain. This is about such a "simple" you ask?
The main difficulty in creating such a chat is how to notify the interlocutor of a new message.
Actually, there are 2 ways:
1) Clumsy and lazy. Through SetInterval(), send requests to the database via ajax and see if there are new records in it.
2) Beautiful and correct. I wrote such a chat, but since the stack was ASP.NET, I used SignalR (dotnet wrapper for WebSocket). But since you have a different stack, then read about WebSocket and the corresponding libraries for working with it on the server and on the client.
https://bablofil.ru/nodejs-websocket-chat/
How to write a chat on websocket'ax (javascript)?
https://medv.io/create-chat-on-php/
Everything else is pretty primitive.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question