Module

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. Effect a -> Effect Unit

Run a function when the document is loaded.

#select Source

select :: Selector -> Effect JQuery

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

#find Source

find :: Selector -> JQuery -> Effect JQuery

Find child nodes matching a selector

#parent Source

parent :: JQuery -> Effect JQuery

Get the parent elements.

#closest Source

closest :: Selector -> JQuery -> Effect JQuery

Find the closest element matching the selector.

#create Source

create :: String -> Effect JQuery

Create an element.

#setAttr Source

setAttr :: forall a. String -> a -> JQuery -> Effect Unit

Set a single attribute.

#getAttr Source

getAttr :: String -> JQuery -> Effect (Maybe String)

Get an attribute value.

#attr Source

attr :: forall attr. Record attr -> JQuery -> Effect Unit

Set multiple attributes.

#css Source

css :: forall css. Record css -> JQuery -> Effect Unit

Set CSS properties.

#hasClass Source

hasClass :: String -> JQuery -> Effect Boolean

Test if an element has a CSS class.

#toggleClass Source

toggleClass :: String -> JQuery -> Effect Unit

Toggle the specified CSS class.

#setClass Source

setClass :: String -> Boolean -> JQuery -> Effect Unit

Set the specified CSS class.

#addClass Source

addClass :: String -> JQuery -> Effect Unit

Add the specified CSS class.

#removeClass Source

removeClass :: String -> JQuery -> Effect Unit

Remove the specified CSS class.

#setProp Source

setProp :: forall a. String -> a -> JQuery -> Effect Unit

Set a single property.

#getProp Source

getProp :: String -> JQuery -> Effect Foreign

Get a property value.

#append Source

append :: JQuery -> JQuery -> Effect Unit

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

#remove Source

remove :: JQuery -> Effect Unit

Remove selected elements.

#clear Source

clear :: JQuery -> Effect Unit

Remove child elements.

#before Source

before :: JQuery -> JQuery -> Effect Unit

Insert an element before another.

#appendText Source

appendText :: String -> JQuery -> Effect Unit

Append text as a child node.

#body Source

body :: Effect JQuery

Get the document body node.

#getText Source

getText :: JQuery -> Effect String

Get the text content of an element.

#setText Source

setText :: String -> JQuery -> Effect Unit

Set the text content of an element.

#getHtml Source

getHtml :: JQuery -> Effect String

Get the html content of an element.

#setHtml Source

setHtml :: String -> JQuery -> Effect Unit

Set the html content of an element

#getValue Source

getValue :: JQuery -> Effect Foreign

Get the value of a form element.

#setValue Source

setValue :: forall a. a -> JQuery -> Effect Unit

Set the value of a form element.

#toggle Source

toggle :: JQuery -> Effect Unit

Toggle visibility of an element.

#setVisible Source

setVisible :: Boolean -> JQuery -> Effect Unit

Set the visibility of an element.

#hide Source

hide :: JQuery -> Effect Unit

Hide elements.

#display Source

display :: JQuery -> Effect Unit

Show elements.

#on Source

on :: forall a. String -> (JQueryEvent -> JQuery -> Effect a) -> JQuery -> Effect Unit

Register an event handler.

#on' Source

on' :: forall a. String -> Selector -> (JQueryEvent -> JQuery -> Effect a) -> JQuery -> Effect Unit

Register an event handler for elements matching a selector.

#off Source

off :: String -> JQuery -> Effect Unit

Remove an event handler.

#off' Source

off' :: JQuery -> Effect Unit

Remove all event handler.

#toArray Source

toArray :: JQuery -> Effect (Array JQuery)

Get an array of matching elements.

#preventDefault Source

preventDefault :: JQueryEvent -> Effect Unit

Prevent the default action for an event.

#stopPropagation Source

stopPropagation :: JQueryEvent -> Effect Unit

Stop propagation an event.

#stopImmediatePropagation Source

stopImmediatePropagation :: JQueryEvent -> Effect Unit

Stop immediate propagation an event.

#getTarget Source

getTarget :: JQueryEvent -> Effect JQuery

Get the target propery of the event object.

#getCurrentTarget Source

getCurrentTarget :: JQueryEvent -> Effect JQuery

Get the currentTarget property from the event object.

#getPageX Source

getPageX :: JQueryEvent -> Effect Number

Get the pageX property from the event object.

#getPageY Source

getPageY :: JQueryEvent -> Effect Number

Get the pageY property from the event object.

#getWhich Source

getWhich :: JQueryEvent -> Effect Int

Get the which property from the event object.

#getMetaKey Source

getMetaKey :: JQueryEvent -> Effect Boolean

Get the metaKey property from the event object.

#clone Source

clone :: JQuery -> Effect JQuery

Create a deep copy of the set of matched elements.

#cloneWithDataAndEvents Source

cloneWithDataAndEvents :: JQuery -> Effect JQuery

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

Modules
JQuery