How to make all connected browsers reload initiated by a server-side event

前端 未结 7 1405
忘掉有多难
忘掉有多难 2020-12-19 17:42

Suppose there is a webpage with dynamically generated content -- say a div containing the current number of connected browsers. When the count changes on the server I want a

7条回答
  •  悲&欢浪女
    2020-12-19 17:59

    it is possible to write a java applet which can work as a network server. Once the applet has successfully started, it can report its port and ip number back to the remote server.

    Then your server can send messages to the client server any time it feels like. Your java applet can then hand the message off to javascript, or do whatever else.

    This method requires java plugin support however, which is far from universal.

提交回复
热议问题