.TH "Eliom_content.Html5.F" 3o 2014-07-10 OCamldoc "" .SH NAME Eliom_content.Html5.F \- Creation of functional HTML5 content (copy-able but not referable). .SH Module Module Eliom_content.Html5.F .SH Documentation .sp Module .BI "F" : .B sig end .sp Creation of functional HTML5 content (copy\-able but not referable)\&. .sp .sp .sp .sp .PP .B === .B Content creation .B .B See {% <> %} === .PP .I module Raw : .B sig end .sp Cf\&. \&. .sp .sp .I include Eliom_content.Html5.F.Raw .sp .sp .PP .B === .B Event handlers .B === .PP .I val a_onabort : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnAbort ] Eliom_content.Html5.attrib .sp Redefine event handler attributes to simplify their usage\&. .sp .sp .I val a_onafterprint : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnAfterPrint ] Eliom_content.Html5.attrib .sp .sp .I val a_onbeforeprint : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnBeforePrint ] Eliom_content.Html5.attrib .sp .sp .I val a_onbeforeunload : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnBeforeUnload ] Eliom_content.Html5.attrib .sp .sp .I val a_onblur : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnBlur ] Eliom_content.Html5.attrib .sp .sp .I val a_oncanplay : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnCanPlay ] Eliom_content.Html5.attrib .sp .sp .I val a_oncanplaythrough : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnCanPlayThrough ] Eliom_content.Html5.attrib .sp .sp .I val a_onchange : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnChange ] Eliom_content.Html5.attrib .sp .sp .I val a_onclick : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnClick ] Eliom_content.Html5.attrib .sp .sp .I val a_oncontextmenu : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnContextMenu ] Eliom_content.Html5.attrib .sp .sp .I val a_ondblclick : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDblClick ] Eliom_content.Html5.attrib .sp .sp .I val a_ondrag : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDrag ] Eliom_content.Html5.attrib .sp .sp .I val a_ondragend : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDragEnd ] Eliom_content.Html5.attrib .sp .sp .I val a_ondragenter : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDragEnter ] Eliom_content.Html5.attrib .sp .sp .I val a_ondragleave : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDragLeave ] Eliom_content.Html5.attrib .sp .sp .I val a_ondragover : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDragOver ] Eliom_content.Html5.attrib .sp .sp .I val a_ondragstart : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDragStart ] Eliom_content.Html5.attrib .sp .sp .I val a_ondrop : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDrop ] Eliom_content.Html5.attrib .sp .sp .I val a_ondurationchange : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnDurationChange ] Eliom_content.Html5.attrib .sp .sp .I val a_onemptied : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnEmptied ] Eliom_content.Html5.attrib .sp .sp .I val a_onended : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnEnded ] Eliom_content.Html5.attrib .sp .sp .I val a_onerror : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnError ] Eliom_content.Html5.attrib .sp .sp .I val a_onfocus : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnFocus ] Eliom_content.Html5.attrib .sp .sp .I val a_onformchange : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnFormChange ] Eliom_content.Html5.attrib .sp .sp .I val a_onforminput : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnFormInput ] Eliom_content.Html5.attrib .sp .sp .I val a_onhashchange : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnHashChange ] Eliom_content.Html5.attrib .sp .sp .I val a_oninput : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnInput ] Eliom_content.Html5.attrib .sp .sp .I val a_oninvalid : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnInvalid ] Eliom_content.Html5.attrib .sp .sp .I val a_onmousedown : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnMouseDown ] Eliom_content.Html5.attrib .sp .sp .I val a_onmouseup : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnMouseUp ] Eliom_content.Html5.attrib .sp .sp .I val a_onmouseover : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnMouseOver ] Eliom_content.Html5.attrib .sp .sp .I val a_onmousemove : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnMouseMove ] Eliom_content.Html5.attrib .sp .sp .I val a_onmouseout : .B (Dom_html.mouseEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnMouseOut ] Eliom_content.Html5.attrib .sp .sp .I val a_onmousewheel : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnMouseWheel ] Eliom_content.Html5.attrib .sp .sp .I val a_onoffline : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnOffLine ] Eliom_content.Html5.attrib .sp .sp .I val a_ononline : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnOnLine ] Eliom_content.Html5.attrib .sp .sp .I val a_onpause : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnPause ] Eliom_content.Html5.attrib .sp .sp .I val a_onplay : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnPlay ] Eliom_content.Html5.attrib .sp .sp .I val a_onplaying : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnPlaying ] Eliom_content.Html5.attrib .sp .sp .I val a_onpagehide : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnPageHide ] Eliom_content.Html5.attrib .sp .sp .I val a_onpageshow : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnPageShow ] Eliom_content.Html5.attrib .sp .sp .I val a_onpopstate : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnPopState ] Eliom_content.Html5.attrib .sp .sp .I val a_onprogress : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnProgress ] Eliom_content.Html5.attrib .sp .sp .I val a_onratechange : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnRateChange ] Eliom_content.Html5.attrib .sp .sp .I val a_onreadystatechange : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnReadyStateChange ] Eliom_content.Html5.attrib .sp .sp .I val a_onredo : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnRedo ] Eliom_content.Html5.attrib .sp .sp .I val a_onresize : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnResize ] Eliom_content.Html5.attrib .sp .sp .I val a_onscroll : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnScroll ] Eliom_content.Html5.attrib .sp .sp .I val a_onseeked : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnSeeked ] Eliom_content.Html5.attrib .sp .sp .I val a_onseeking : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnSeeking ] Eliom_content.Html5.attrib .sp .sp .I val a_onselect : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnSelect ] Eliom_content.Html5.attrib .sp .sp .I val a_onshow : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnShow ] Eliom_content.Html5.attrib .sp .sp .I val a_onstalled : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnStalled ] Eliom_content.Html5.attrib .sp .sp .I val a_onstorage : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnStorage ] Eliom_content.Html5.attrib .sp .sp .I val a_onsubmit : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnSubmit ] Eliom_content.Html5.attrib .sp .sp .I val a_onsuspend : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnSuspend ] Eliom_content.Html5.attrib .sp .sp .I val a_ontimeupdate : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnTimeUpdate ] Eliom_content.Html5.attrib .sp .sp .I val a_onundo : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnUndo ] Eliom_content.Html5.attrib .sp .sp .I val a_onunload : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnUnload ] Eliom_content.Html5.attrib .sp .sp .I val a_onvolumechange : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnVolumeChange ] Eliom_content.Html5.attrib .sp .sp .I val a_onwaiting : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnWaiting ] Eliom_content.Html5.attrib .sp .sp .I val a_onkeypress : .B (Dom_html.keyboardEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnKeyPress ] Eliom_content.Html5.attrib .sp .sp .I val a_onkeydown : .B (Dom_html.keyboardEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnKeyDown ] Eliom_content.Html5.attrib .sp .sp .I val a_onkeyup : .B (Dom_html.keyboardEvent Js.t -> unit) Eliom_lib.client_value -> .B [> `OnKeyUp ] Eliom_content.Html5.attrib .sp .sp .I val a_onload : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnLoad ] Eliom_content.Html5.attrib .sp .sp .I val a_onloadeddata : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnLoadedData ] Eliom_content.Html5.attrib .sp .sp .I val a_onloadedmetadata : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnLoadedMetaData ] Eliom_content.Html5.attrib .sp .sp .I val a_onloadstart : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnLoadStart ] Eliom_content.Html5.attrib .sp .sp .I val a_onmessage : .B (Dom_html.event Js.t -> unit) Eliom_lib.client_value -> .B [> `OnMessage ] Eliom_content.Html5.attrib .sp .sp .PP .B === .B Forms creation .B === .PP .PP .B === .B Links and forms .B === .PP .I val make_uri : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B service:('get, unit, [< Eliom_service.get_service_kind ], .B [< Eliom_service.suff ], 'gn, unit, [< Eliom_service.registrable ], .B 'return) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> 'get -> Eliom_content.Xml.uri .sp The function .B make_uri service get_params returns the URL of the service .B service applied to the GET parameters .B get_params \&. By default the returned URL is relative to the current request URL but it is absolute when one of the following conditions is met: .sp .sp \-the optional parameter .B ~absolute_path is .B true \&. .sp \-the optional parameter .B ~absolute is .B true \&. .sp \-the optional parameter .B ~https is .B true (resp\&. .B false ) and the current request protocol is .B http (resp\&. .B https )\&. .sp \-the optional parameter .B ~https is .B true and the function is used outside of a service handler .sp \-the .B service has been created with .B ~https:true and the current request protocol is .B http \&. .sp \-the .B service has been created with .B ~https:true and the function is used outside of a service handler\&. When only the first condition is met ( .B ~absolute_path is .B true ) the returned URL is just the absolute path, but when any other condition is satisfied the returned URL is prefixed with .B protocol://hostname[:port] , where: .sp .sp \- .B protocol is: .sp \- .B https if the .B service has been created with .B ~https:true or the optional parameter .B ~https is .B true ; .sp \- .B http if the optional parameter .B ~https is .B false ; .sp \-the current request protocol if available; .sp \- .B http in any other case\&. .sp \- .B hostname is: .sp \-the optional parameter .B ~hostname if given; .sp \-the attribute .B defaulthostname of .B tag in configuration file or the machine hostname if the option .B is set; .sp \-the .B Host http header of the current request if available; .sp \-the attribute .B defaulthostname of .B tag in configuration file or the machine hostname in any other case\&. .sp \- .B port is: .sp \-the optional parameter .B ~port if given; .sp \-the attribute .B defaulthttpsport (resp\&. .B defaulthttpport ) of .B tag in configuration file or .B 443 (resp\&. 80) if .B protocol is .B https (resp\&. .B http ) and the current request protocol is .B http (resp\&. .B https ); .sp \-the attribute .B defaulthttpsport (resp\&. .B defaulthttpsport ) of .B tag in configuration file or .B 443 (resp\&. 80) if the option .B is set and .B protocol is .B https (resp\&. .B http ); .sp \-the port associated to the .B Host http header of the current request if available; .sp \-the incoming port of the current request if available; .sp \-the attribute .B defaulthttpport (resp\&. .B defaulthttpsport ) of .B tag in configuration file or .B 80 (resp\&. .B 443 ) in any other case\&. If given the optional parameter .B ~fragment is prefixed by .B # and appended to the URL\&. .sp The optional parameter .B keep_nl_params allows one to override the .B keep_nl_params parameter used when creating the .B service , see .B Eliom_service\&.Http\&.service for a detailled description\&. .sp The optional parameter .B nl_params allows one to add non localized GET parameter to the URL\&. See the eliom manual for more information about \&. .sp .sp .I val make_string_uri : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B service:('get, unit, [< Eliom_service.get_service_kind ], .B [< Eliom_service.suff ], 'gn, unit, [< Eliom_service.registrable ], .B 'return) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> 'get -> string .sp The function .B make_string_uri service get_params returns the URL of the of the service .B service applied to the GET parameters .B get_params \&. See .B Eliom_content\&.Html5\&.F\&.make_uri for a detailled description of optional parameters\&. .sp The function .B make_string_uri is an alias of .B Eliom_uri\&.make_string_uri \&. .sp Warning: The function .B make_string_uri should not be called outside of a service handler, unless one of the following condition is met: .sp .sp \-the optional parameter .B ~absolute_path is .B true \&. .sp \-the optional parameter .B ~absolute is .B true \&. .sp \-the optional parameter .B ~https is .B true \&. .sp \-the .B service has been created with .B ~https:true \&. .sp \-the .B service is an external service\&. .sp .sp .I val uri_of_string : .B (unit -> string) -> Eliom_content.Xml.uri .sp The function .B uri_of_string f returns a URI whose content is equivalent to .B f () \&. .sp For XML tree build with TyXML, like .B Eliom_content\&.Html5 or .B Eliom_content\&.Svg\&.F , the function .B f is applied each time the XML tree is sent to the client (either as page content or as a marshalled OCaml value)\&. Hence, the function is always evaluated in the context of a service handler\&. .sp For other module, the function .B f is immediatly applied\&. .sp .sp .I val make_uri_components : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B service:('get, unit, [< Eliom_service.get_service_kind ], .B [< Eliom_service.suff ], 'gn, unit, [< Eliom_service.registrable ], .B 'return) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> .B 'get -> string * (string * Eliommod_parameters.param) list * string option .sp The function .B make_uri_components service get_params returns the a triplet .B (path, get_params, fragment) that is a decomposition of the URL for the service .B service applied to the GET parameters .B get_params \&. By default the returned .B path is relative to the current request URL but it could be absolute URL in some situation, see .B Eliom_content\&.Html5\&.F\&.make_uri for more information and a description of optional parameters\&. .sp The function .B make_uri_components is an alias for .B Eliom_uri\&.make_uri_components \&. .sp Warning: depending on the optional parameters, the function .B make_uri_components may not be used outside of a service handler\&. See .B Eliom_content\&.Html5\&.F\&.make_string_uri for a detailled description\&. .sp .sp .I val make_post_uri_components : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B service:('get, 'post, [< Eliom_service.post_service_kind ], .B [< Eliom_service.suff ], 'gn, 'pn, [< Eliom_service.registrable ], .B 'return) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> .B ?keep_get_na_params:bool -> .B 'get -> .B 'post -> .B string * (string * Eliommod_parameters.param) list * string option * .B (string * Eliommod_parameters.param) list .sp Same a .B Eliom_content\&.Html5\&.F\&.make_uri_components , but also returns a list of post parameters\&. .sp .sp .I val a : .B ?absolute:bool -> .B ?absolute_path:bool -> .B ?https:bool -> .B ?a:Html5_types.a_attrib Eliom_content.Html5.attrib list -> .B service:('get, unit, [< Eliom_service.get_service_kind ], .B [< Eliom_service.suff ], 'd, unit, [< Eliom_service.registrable ], .B [< Eliom_service.non_ocaml_service ]) .B Eliom_service.service -> .B ?hostname:string -> .B ?port:int -> .B ?fragment:string -> .B ?keep_nl_params:[ `All | `None | `Persistent ] -> .B ?nl_params:Eliom_parameter.nl_params_set -> .B ?xhr:bool -> .B 'a Eliom_content.Html5.elt list -> .B 'get -> [> 'a Html5_types.a ] Eliom_content.Html5.elt .sp The function .B a service a_content get_params creates a .B node that link to .B service applied to GET parameters .B get_params and whose content is .B a_content \&. By default, the .B href attribute is a relative URL recomputed at each request with .B Eliom_content\&.Html5\&.F\&.make_uri \&. .sp By default, the link is realized such that the client\-side Eliom application keeps running irrespectable of the usage of the link (cf\&. )\&. .sp By contrast, if the optional parameter .B ~xhr:false is given, the link is realized as a standard HTML link and clicking it discontinues the Eliom application\&. The .B ~xhr parameter has no effect outside an Eliom application\&. .sp NB that the default value of .B ~xhr is configurable through <> .sp The optional parameter .B ~a allows one to add extra HTML attributes to the generated node\&. .sp See .B Eliom_content\&.Html5\&.F\&.make_uri for description of other optional parameters\&. .sp .sp .I val css_link : .B ?a:Html5_types.link_attrib Eliom_content.Html5.attrib list -> .B uri:Eliom_content.Xml.uri -> .B unit -> [> Html5_types.link ] Eliom_content.Html5.elt .sp The function .B css_link ~uri () creates a .B node that reference a Cascading StyleSheet (CSS)\&. .sp If the CSS is generated by an Eliom service, use .B Eliom_content\&.Html5\&.F\&.make_uri to calculate the service URI\&. If the CSS is a static file, you may also use .B Eliom_service\&.static_dir or .B Eliom_service\&.Http\&.external_service to abstract the file with a service\&. .sp The optional parameter .B ~a allows one to add extra HTML attributes to the generated node\&. .sp .sp .I val js_script : .B ?a:Html5_types.script_attrib Eliom_content.Html5.attrib list -> .B uri:Eliom_content.Xml.uri -> .B unit -> [> Html5_types.script ] Eliom_content.Html5.elt .sp The function .B js_script ~uri () creates a .B