File tree Expand file tree Collapse file tree 2 files changed +696
-1
lines changed
Expand file tree Collapse file tree 2 files changed +696
-1
lines changed Original file line number Diff line number Diff line change @@ -536,7 +536,18 @@ PPX annotations allow to split the code into these two programs:
536536
537537Same for {{{module%shared }}}, {{{open%shared }}}, {{{type%shared }}} etc.
538538
539+ {{@@class="doc-img-col-width"@@files/tutorial/client-server.svg|Client-server build system}}
540+
539541===Client values ===
542+ Fragments of client code can be included in server (or shared) sections.
543+
544+ Example:
545+
546+ <<code language="ocaml" class="server"|
547+ button ~a:[a_onclick [%client fun ev -> ... ]] [ ... ]
548+ >>
549+
550+
540551Client values can be declared within server or shared code as
541552 {{{[%client[ (<value> : <type>) ] }}}.
542553The type annotation is almost always required.
@@ -735,7 +746,7 @@ Attributes like {{{a_onclick}}} in module {{{Eliom_content.Html.D}}} or {{{F}}}
735746take a client side function as parameter:
736747
737748<<code language="ocaml" class="shared"|
738- div ~a:[a_onclick [%client fun ev -> ... ]] [ ... ]
749+ button ~a:[a_onclick [%client fun ev -> ... ]] [ ... ]
739750>>
740751
741752Module {{{Lwt_js_events }}} of Js_of_ocaml defines a way to bind browser events
You can’t perform that action at this time.
0 commit comments