This repository was archived by the owner on Feb 2, 2021. It is now read-only.
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Latest commitHistory | ||||
PureScript type declarations for jQuery. See module documentation on Pursuit.
Example
main = ready do -- Get the document body body <- body -- Create a text box div <- create "<div>" input <- create "<input>" appendText "Your Name: " div append input div append div body -- Create a paragraph to display a greeting greeting <- create "<p>" css { color: "red" } greeting append greeting body -- Listen for change events on the text box on "change" (handleChange input greeting) input where handleChange :: JQuery -> JQuery -> JQueryEvent -> JQuery -> Effect Unit handleChange input greeting _ _ = unsafePartial do val <- getValue input for_ (runExcept (readString val)) \name -> do log $ "Name changed to " <> name setText ("Hello, " <> name) greeting
(from test/Main.purs).
Installation
bower i purescript-jquery