The refined SYNRC API of the Nitrogen Web Framework brought to us by Rusty Klophaus.
API
The basic Rusty's idea was to stream small pieces of JavaScript
to the thin client that performs simple eval. This is
server side rendering framework with SDK for creating rich and complex
control elements such as virtual grid or file upload element.
q(atom()) -> term().
Retrieves from process dictionary by atom-key the value of client DOM element
passed by over the network in #ev record as a part of #pickle message.
jse([] | binary()) -> [] | binary().
Performs JavaScript escaping that is safe to eval and <script> injection. See more about
XSS.
hte([] | binary()) -> [] | binary().
Performs HTML escaping that is safe to display as a text on a page.
wire(list(#action{})) -> [].
Updates the process dictionary actions variable with the new list of records inherited from #action.
This process dictionary variable is a way data is passed from your event handlers into the output rendering pipeline.
This is fixed by Nitrogen Web Framework API.
render(list(#action{} | #element{})) -> binary().
Renders HTML5 binary string by the record inherited from #element.
insert_top(atom(), list(#element{})) -> [].
Wires a JavaScript for adding the NITRO element as a first child of a given DOM id at the client.
insert_bottom(atom(), list(#element{})) -> [].
Wires a JavaScript for adding the NITRO element as a last child of a given DOM id at the client.