Very nice idea.<div><br></div><div>But how the browser understand the commands you send from erlang process? for example here: {cmd, fill_div}</div><div><br></div><div>Thants to say, you have to define all the commands and relevant parsing fucntions in a Javascript library?</div>
<div><br></div><div>Thanks,</div><div>Barco<br><br><div class="gmail_quote">On Thu, Dec 13, 2012 at 6:17 PM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ezwebframe<br>==========<br><br><a href="https://github.com/joearms/ezwebframe" target="_blank">https://github.com/joearms/ezwebframe</a><br>
<br>Pronounced "Easy web frame."<br><br>About<br>=====<br><br>Ezwebframe attempts to make web programming just a little bit easier.<br>
<br>From Erlang point of view the browser *is* an Erlang process.<br><br>Assume we have a web page populated with divs. For example:<br><br>    <div id="a"><br>      ...<br>    </div><br><br>    <div id="b"><br>

      ...<br>    </div><br><br>Erlang thinks the browser is a process. To fill div a with HTML an <br>Erlang process evaluates the command:<br><br>     Browser ! [{cmd, fill_div}, {id, a}, {txt, B}]<br><br>Where B is a binary containing HTML.<br>

<br>In the browser controls can be programmed to send messages to Erlang,<br>for example, when we click on a button in the browser the Erlang<br>process controlling the window will be sent a message which can be<br>received with the statement:<br>

<br>    receive<br>       {Browser, {struct, [{clicked, ButtonName}]}} -><br>           ...<br>    end<br><br>All this is achieved using a thin JSON layer over websockets and<br>with cowboy managing the websockets.<br>

<br>Cheers<span class="HOEnZb"><font color="#888888"><br><br>/Joe<br><br><br><br> <br><br><br><br>
</font></span><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>