The task is this. There is a web page on which you need to display information from the database, when it appears there. You can write ajax request to the php script, which would check if the database contains the necessary information and return it to ajax and put it in a loop, but it seems to me that this is a bad implementation. How to implement it correctly?
- why it seems that this is a bad implementation. ? - Grundy
- Either by periodic Ajax requests to the server, or via WebSocket. - Regent
- The existence of WebSocket or Long Polling confuses me, so WebSocket is probably more suitable, but as far as I know, this technology is not very stable and may work / not work in different browsers, servers - antonin14d
- stackoverflow.com/questions/11077857/… - Arnial
- In your task, it will be enough to use SSE. His native support is lower than that of the websocket, but for him there are many polifilov. - Arnial
|