Skip to content
Type declarations for jQuery
PureScript JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
generated-docs updates for 0.12 Aug 6, 2018
html
src
test updates for 0.12 Aug 6, 2018
.gitignore
.travis.yml
LICENSE
README.md
bower.json updates for 0.12 Aug 6, 2018
package.json
psc-package.json Various fixes, updates for 0.10 Oct 25, 2016

README.md

purescript-jquery

Latest release Maintainer: paf31

PureScript type declarations for jQuery.

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
You can’t perform that action at this time.