Search code examples
javascripthtmlvbscriptserver-push

Is it possible to make server push without using javascript?


Is there some mechanism to provide server push technology using plain HTML, without using javascript (or any other script languages on the client side).

Under "server push" I mean process where the server to update some part of the page content when needed.


Solution

  • I don't know of any way that true server push can be used without any javascript in the page.

    Without javascript, the only thing I'm aware of is a meta refresh tag that would tell the browser to refresh this page after some particular time interval. This tag applies to a whole page only. If you wanted only part of a page to be updated, you could use an iframe and have only the iframe be updated. Of course, this is not server push, but a client-driven auto-update and it will be run on a predetermined interval, not just when there is actually new data. For something smarter than this, you will need javascript.

    The most efficient server-push would be to use javascript from the page to connect to your server over a websocket and then have the server just send data to the page via the websocket whenever it wants (true server-push). The client's javascript can then respond to the receipt of that websocket data by updating a particular piece of the page.