September 2013
Intermediate to advanced
548 pages
12h 25m
English
So far, we’ve seen only text in the browser. As soon as we can push graphic objects to the browser, a whole new world opens. This is really easy, since we can use the Scalable Vector Graphics (SVG) format that is built into modern browsers.

Here’s what we are going to do. We’ll create an SVG canvas in the browser with a button below it. When the button is clicked, a message is sent to Erlang. Erlang replies with a command telling the browser to add a rectangle to the SVG canvas. The previous screenshot shows the widget after clicking the draw rectangle button five times. The Erlang code to do this is as follows:
| websockets/svg1.erl ... |
Read now
Unlock full access