package js_of_ocaml

  1. Overview
  2. Docs
Compiler from OCaml bytecode to JavaScript

Install

Dune Dependency

Authors

Maintainers

Sources

js_of_ocaml-3.10.0.tbz
sha256=7bfe95c283e30a53df9364555517aa4ea614876be566a86b33e6d0fefc4a6126
sha512=1815f0bfcea65a28082293756350a9365304584d3a19af0983e1498c6f8d7d25a751aec18560aa7b633b64b8adfb4417e9647cdf703bedcb7aaf316abf9a3243

doc/js_of_ocaml/Js_of_ocaml/MutationObserver/index.html

Module Js_of_ocaml.MutationObserver

MutationObserver API

A code example:

  if (MutationObserver.is_supported()) then
    let doc = Dom_html.document in
    let target =
      Js.Opt.get (doc##getElementById (Js.string "observed"))
        (fun () -> assert false)
    in
    let node = (target :> Dom.node Js.t) in
    let f records observer =
      Firebug.console##debug records ;
      Firebug.console##debug observer
    in
    MutationObserver.observe ~node ~f
      ~attributes:true ~child_list:true ~character_data:true
      ()
class type mutationObserverInit = object ... end
class type mutationRecord = object ... end
class type mutationObserver = object ... end
val empty_mutation_observer_init : unit -> mutationObserverInit Js.t
val is_supported : unit -> bool
val observe : node:Dom.node Js.t -> f:(mutationRecord Js.t Js.js_array Js.t -> mutationObserver Js.t -> unit) -> ?child_list:bool -> ?attributes:bool -> ?character_data:bool -> ?subtree:bool -> ?attribute_old_value:bool -> ?character_data_old_value:bool -> ?attribute_filter:Js.js_string Js.t list -> unit -> mutationObserver Js.t

Helper to create a new observer and connect it to a node

OCaml

Innovation. Community. Security.