JavaScript helpers
JavaScript helpers
JavaScript for current on-change event value
JavaScript for current on-change event value
JS for checking if enter was pressed
JS for checking if enter was pressed
JS for checking if escape was pressed
JS for checking if escape was pressed
(eval-js-from-source source)
Output a script element that evaluates JS code from source. Evaluates JS whenever source changes. The source values must be valid scripts.
Output a script element that evaluates JS code from source. Evaluates JS whenever source changes. The source values must be valid scripts.
(export-callbacks js-name->callback)
(export-callbacks object-name js-name->callback)
Output a JS script tag that exposes the given callbacks as global JS functions or inside a global object.
Names must be keywords denoting valid JS function names.
eg. (export-callbacks {:foo #(println "Hello" %)})
will create a JS function called foo
that takes 1 argument
and invokes the server side callback with it.
Output a JS script tag that exposes the given callbacks as global JS functions or inside a global object. Names must be keywords denoting valid JS function names. eg. `(export-callbacks {:foo #(println "Hello" %)})` will create a JS function called `foo` that takes 1 argument and invokes the server side callback with it.
(form-values form-selector)
Extract form values as a map of key/value.
Extract form values as a map of key/value.
(input-value id)
Generate JS for getting the value of an input field by id.
Generate JS for getting the value of an input field by id.
(js callback-fn & js-params)
Create a JavaScript callback that evaluates JS in browser to get parameters
Create a JavaScript callback that evaluates JS in browser to get parameters
(js-debounced debounce-ms callback-fn & js-params)
Create callback that sends value only when parameters settle (aren't changed within given ms). This is useful for input values to prevent sending on each keystroke, only when user stops typing.
Create callback that sends value only when parameters settle (aren't changed within given ms). This is useful for input values to prevent sending on each keystroke, only when user stops typing.
(js-when js-condition callback-fn & js-params)
Create a conditionally fired JS callback.
Create a conditionally fired JS callback.
JavaScript for current event keycode
JavaScript for current event keycode
(keycode-pressed? keycode)
Return JS code for checking if keypress event has given keycode
Return JS code for checking if keypress event has given keycode
(on-failure callback on-failure-js)
Add JS code that handles callback failure.
Add JS code that handles callback failure.
(on-success callback on-success-js)
Add JS code that is run after the callback is processed on the server.
Add JS code that is run after the callback is processed on the server.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close