[erlang-questions] how: ot: real time web pages?
Sun Dec 2 11:24:27 CET 2007
a little erlang http server
Here is an outline of the method.
1) Wrap the regions you want to change with unique tags
<div id="12345"> ... </id>
2) To change the content within this tag you need to execute a
document.getElemenById("12345").innerHTML = "..... some html""
should NOT return immediately
but return when the next update is required. The erlang return value
should return a string which contains the
"document.getElementByCommand command" - on getting the return value
4) Every time erlang returns you update the region on the page and
immediately call erlang again
which suspends until the next update comes.
I don't actually have short example of this - I have code for this
wrapped up in a lot of other
junk that obscure the simplicity of the solution.
started by doing the exercises at
You also need to setup some server side stuff ( a little http server -
this can be as easy or difficult
as you like ...)
On Dec 2, 2007 8:25 AM, Jouni Rynö <> wrote:
> I start from what I would like to have:
> A web page with a real time updated display of numerical values and
> graphs. Think about typical process displays in industry,
> temperatures, voltages and some graphs showing parameter history.
> Maybe some graphical layout of hardware, to show how each parameter
> is connected to each other.
> To achieve that, I would need a web page template format, where I can:
> - define named text fields, which shall be updated
> - define named graphics, which can be updated
> - and some code to generate the real page and connection functions
> for (comet style?) communication with the page and erlang process
> feeding the data
> Currently I have all that implemented as Tcl/Tk canvas (thanks to Ola
> Samuelsson and ewish, which was distributed with Erlang back in 97 or
> get a hint on how to do this. Googling shows a lot of options, most
> and svg, changes updated via attributes. Or canvas tag (complicated
> with text fields?) Or haxe and flash (for which I did not find
> examples, how the update mechanism would work) Or something else?
> Is this doable? Some examples existing already?
> erlang-questions mailing list
More information about the erlang-questions