Module

Specular.Dom.Browser

Package
purescript-specular
Repository
restaumatic/purescript-specular

#(:=) Source

Operator alias for Foreign.Object.singleton (non-associative / precedence 8)

Convenient syntax for building Attrs

#TagName Source

#Namespace Source

type Namespace = String

XML namespace URI.

#Node Source

data Node

DOM node.

#Event Source

data Event

DOM event.

#EventType Source

type EventType = String

HTML event type, e.g. "click".

#addEventListener Source

addEventListener :: EventType -> (Event -> Effect Unit) -> Node -> Effect (Effect Unit)

Register an event listener. Returns unregister action.

#createDocumentFragment Source

#createElementNS Source

createElementNS :: Maybe Namespace -> TagName -> Effect Node

Create an element, optionally with namespace.

#setAttributes Source

#parentNode Source

parentNode :: Node -> Effect (Maybe Node)

Return parent node of the node, or Nothing if it has been detached.

#insertBefore Source

insertBefore :: Node -> Node -> Node -> Effect Unit

insertBefore newNode nodeAfter parent Insert newNode before nodeAfter in parent

#appendChild Source

appendChild :: Node -> Node -> Effect Unit

appendChild newNode parent

#appendRawHtml Source

appendRawHtml :: String -> Node -> Effect Unit

Append a chunk of raw HTML to the end of the node.

#removeAllBetween Source

removeAllBetween :: Node -> Node -> Effect Unit

removeAllBetween from to

Remove all nodes after from and before to from their parent. from and to are not removed.

Assumes that from and to have the same parent, and from is before to.

#moveAllBetweenInclusive Source

moveAllBetweenInclusive :: Node -> Node -> Node -> Effect Unit

moveAllBetweenInclusive from to parent

Moves from, all nodes after from and before to and to to parent.

Assumes that from and to have the same parent, and from is before to.

#removeNode Source

removeNode :: Node -> Effect Unit

Remove node from its parent node. No-op when the node has no parent.

#createTextNodeImpl Source

#createDocumentFragmentImpl Source

#removeAttributesImpl Source

#parentNodeImpl Source

#insertBeforeImpl Source

#appendChildImpl Source

#removeAllBetweenImpl Source

#appendRawHtmlImpl Source

#moveAllBetweenInclusiveImpl Source

#addEventListenerImpl Source

#preventDefault Source

preventDefault :: Event -> Effect Unit

JS Event.preventDefault().

#innerHTML Source

innerHTML :: Node -> Effect String

Get innerHTML of a node.