Module

Control.Monad.Eff.JQuery

Package
purescript-jquery
Repository
paf31/purescript-jquery

This module defines foreign types and functions for working with the jQuery library.

#JQuery Source

data JQuery :: Type

The type of collections of jQuery-wrapped nodes.

#JQueryEvent Source

data JQueryEvent :: Type

Type of jQuery event objects.

#Selector Source

type Selector = String

A type synonym to help readability of type signatures.

#ready Source

ready :: forall a eff. Eff (dom :: DOM | eff) a -> Eff (dom :: DOM | eff) Unit

Run a function when the document is loaded.

#select Source

select :: forall eff. Selector -> Eff (dom :: DOM | eff) JQuery

Wrapper function for jQuery selection $('..')

#find Source

find :: forall eff. Selector -> JQuery -> Eff (dom :: DOM | eff) JQuery

Find child nodes matching a selector

#parent Source

parent :: forall eff. JQuery -> Eff (dom :: DOM | eff) JQuery

Get the parent elements.

#closest Source

closest :: forall eff. Selector -> JQuery -> Eff (dom :: DOM | eff) JQuery

Find the closest element matching the selector.

#create Source

create :: forall eff. String -> Eff (dom :: DOM | eff) JQuery

Create an element.

#setAttr Source

setAttr :: forall a eff. String -> a -> JQuery -> Eff (dom :: DOM | eff) Unit

Set a single attribute.

#attr Source

attr :: forall attr eff. Record attr -> JQuery -> Eff (dom :: DOM | eff) Unit

Set multiple attributes.

#css Source

css :: forall css eff. Record css -> JQuery -> Eff (dom :: DOM | eff) Unit

Set CSS properties.

#hasClass Source

hasClass :: forall eff. String -> JQuery -> Eff (dom :: DOM | eff) Boolean

Test if an element has a CSS class.

#toggleClass Source

toggleClass :: forall eff. String -> JQuery -> Eff (dom :: DOM | eff) Unit

Toggle the specified CSS class.

#setClass Source

setClass :: forall eff. String -> Boolean -> JQuery -> Eff (dom :: DOM | eff) Unit

Set the specified CSS class.

#addClass Source

addClass :: forall eff. String -> JQuery -> Eff (dom :: DOM | eff) Unit

Add the specified CSS class.

#removeClass Source

removeClass :: forall eff. String -> JQuery -> Eff (dom :: DOM | eff) Unit

Remove the specified CSS class.

#setProp Source

setProp :: forall eff a. String -> a -> JQuery -> Eff (dom :: DOM | eff) Unit

Set a single property.

#getProp Source

getProp :: forall eff. String -> JQuery -> Eff (dom :: DOM | eff) Foreign

Get a property value.

#append Source

append :: forall eff. JQuery -> JQuery -> Eff (dom :: DOM | eff) Unit

Append the first node as a child node of the second.

#remove Source

remove :: forall eff. JQuery -> Eff (dom :: DOM | eff) Unit

Remove selected elements.

#clear Source

clear :: forall eff. JQuery -> Eff (dom :: DOM | eff) Unit

Remove child elements.

#before Source

before :: forall eff. JQuery -> JQuery -> Eff (dom :: DOM | eff) Unit

Insert an element before another.

#appendText Source

appendText :: forall eff. String -> JQuery -> Eff (dom :: DOM | eff) Unit

Append text as a child node.

#body Source

body :: forall eff. Eff (dom :: DOM | eff) JQuery

Get the document body node.

#getText Source

getText :: forall eff. JQuery -> Eff (dom :: DOM | eff) String

Get the text content of an element.

#setText Source

setText :: forall eff. String -> JQuery -> Eff (dom :: DOM | eff) Unit

Set the text content of an element.

#getHtml Source

getHtml :: forall eff. JQuery -> Eff (dom :: DOM | eff) String

Get the html content of an element.

#setHtml Source

setHtml :: forall eff. String -> JQuery -> Eff (dom :: DOM | eff) Unit

Set the html content of an element

#getValue Source

getValue :: forall eff. JQuery -> Eff (dom :: DOM | eff) Foreign

Get the value of a form element.

#setValue Source

setValue :: forall a eff. a -> JQuery -> Eff (dom :: DOM | eff) Unit

Set the value of a form element.

#toggle Source

toggle :: forall eff. JQuery -> Eff (dom :: DOM | eff) Unit

Toggle visibility of an element.

#setVisible Source

setVisible :: forall eff. Boolean -> JQuery -> Eff (dom :: DOM | eff) Unit

Set the visibility of an element.

#hide Source

hide :: forall eff. JQuery -> Eff (dom :: DOM | eff) Unit

Hide elements.

#display Source

display :: forall eff. JQuery -> Eff (dom :: DOM | eff) Unit

Show elements.

#on Source

on :: forall a eff. String -> (JQueryEvent -> JQuery -> Eff (dom :: DOM | eff) a) -> JQuery -> Eff (dom :: DOM | eff) Unit

Register an event handler.

#on' Source

on' :: forall a eff. String -> Selector -> (JQueryEvent -> JQuery -> Eff (dom :: DOM | eff) a) -> JQuery -> Eff (dom :: DOM | eff) Unit

Register an event handler for elements matching a selector.

#toArray Source

toArray :: forall eff. JQuery -> Eff (dom :: DOM | eff) (Array JQuery)

Get an array of matching elements.

#preventDefault Source

preventDefault :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) Unit

Prevent the default action for an event.

#stopPropagation Source

stopPropagation :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) Unit

Stop propagation an event.

#stopImmediatePropagation Source

stopImmediatePropagation :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) Unit

Stop immediate propagation an event.

#getTarget Source

getTarget :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) JQuery

Get the target propery of the event object.

#getCurrentTarget Source

getCurrentTarget :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) JQuery

Get the currentTarget property from the event object.

#getPageX Source

getPageX :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) Number

Get the pageX property from the event object.

#getPageY Source

getPageY :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) Number

Get the pageY property from the event object.

#getWhich Source

getWhich :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) Int

Get the which property from the event object.

#getMetaKey Source

getMetaKey :: forall eff. JQueryEvent -> Eff (dom :: DOM | eff) Boolean

Get the metaKey property from the event object.

#clone Source

clone :: forall eff. JQuery -> Eff (dom :: DOM | eff) JQuery

Create a deep copy of the set of matched elements.

#cloneWithDataAndEvents Source

cloneWithDataAndEvents :: forall eff. JQuery -> Eff (dom :: DOM | eff) JQuery

Create a deep copy of the set of matched elements, including event handlers and element data.