[erlang-questions] how: ot: real time web pages?
Sun Dec 2 12:12:28 CET 2007
innerHTML can act differently across browsers and libraries like jquery,
help get away from filddling cross browser requirement, the dom selection is
$("#12345").html("..... some html")
another possible implementation would be flash, in which you can have a
connection that is used to notify updates to the client that a value has
updated. it also
has graphing libraries in flex and certainly more powerful for drawing
canvas tags and svg are quite severely restricted in browser requirements,
for existing code
On 02/12/2007, Joe Armstrong <erlang@REDACTED> wrote:
> 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ö <Jouni.Ryno@REDACTED> 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
> > so?)
> > 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?
> > Jouni
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions