search

Home  >  Q&A  >  body text

Thinkphp3.2.3 no refresh update problem

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?

PHPzPHPz2796 days ago430

reply all(2)I'll reply

  • 阿神

    阿神2017-05-16 13:14:38

    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.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:14:38

    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

    reply
    0
  • Cancelreply