RejectedSoftware Forums

Sign up

Is is possible to inject dynamic data from the server only in specific sections of an existing html client file

Hi,
I want to realize a web page that contains a Unity3D web player and some stats (in page, not in player). The client would automatically poll stats updates from the server every X seconds.

My questions are :

  1. Is is possible to inject dynamic data from the server only in specific sections of an existing html client file?

  2. The player « instance » needs to be static, I can’t refresh/reload it everytime the client update its stats. Is it possible to completely renew the html to the client without affecting the player instance?

  3. I was planning to prepare the stats on the server side, hand them out through the http response and parse/format them on the client side. I don’t appreciate Javascript, is their another way to do it?

I would really like to use the Vibe framework and that is why I ask those general questions here.

Thanks.
Olivier

Re: Is is possible to inject dynamic data from the server only in specific sections of an existing html client file

As far as I can see there are only two options: Either really use JavaScript and replace the part of the DOM that contains the stats, or use an <iframe> with an automatically refreshing page inside. I don't think it is possible to refresh the whole page and at the same time keep the plug-in running.

The <iframe> should be very straight forward, but might show some flickering during the refresh. The JavaScript way is a bit more involved, but it could do seemless updates of the page and also real-time updates become possible using a WebSocket connection.

Re: Is is possible to inject dynamic data from the server only in specific sections of an existing html client file

Super! thx.

p.s: Your work on vibe.d is terrific and really appreciated. Thx again. :)