Thinkphp3.2.3 no refresh update problem
PHPz
PHPz 2017-05-16 13:12:38
0
2
437

For example, the data in my database is 5 and then the page is 5. Now I change the data in the database to 10. I want the page to be updated to 10 but there is no need to update the page. How do I do this?

PHPz
PHPz

学习是最好的投资!

reply all(2)
阿神

This can be simplified to 服务器向客户端通信’s problem.
The ways to solve this problem are (as far as I know):

  • Websocket

  • Adobe Flash Socket

  • AJAX long polling

  • JSONP Polling

It is recommended to simply implement polling or websocket yourself.
There is also a mature librarysocket.io, which is used to see SF’s message notifications.

The subject can use the keywords here to search on search engines.

我想大声告诉你

Don’t think about complexity, long connections and communications complicate simple things.

For less demanding scenarios, you can try each N秒使用AJAX去服务器取数据(JSON) and redraw it on the page to achieve your requirements.

If you must ensure real-time, you can only use long connections and communication fields

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template