ezwebframe<br>==========<br><br><a href="https://github.com/joearms/ezwebframe">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<br><br>/Joe<br><br><br><br> <br><br><br><br>