xjs

package
v0.0.0-...-5a689ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2018 License: ISC Imports: 4 Imported by: 0

README

xjs

-- import "github.com/MJKWoolnough/gopherjs/xjs"

Package xjs provides some simple, but often needed shortcut funcs for gopherJS

Usage

func Alert
func Alert(format string, params ...interface{})

Alert provides for formated alert boxes

func AppendChildren
func AppendChildren(parent dom.Node, children ...dom.Node) dom.Node

AppendChildren appends all the given children to the parent.

func Body
func Body() *dom.HTMLBodyElement

Body gets the document's body element

func CreateElement
func CreateElement(name string) dom.Element

CreateElement is a shortcut to create an element with the given name

func Log
func Log(format string, params ...interface{})

Log prints a formatted string to the javascript console

func RemoveChildren
func RemoveChildren(node dom.Node) dom.Node

RemoveChildren removes all of the child nodes of the node given

func SetInnerText
func SetInnerText(node dom.Node, text string) dom.Node

SetInnerText removes all child nodes from the given node and sets a single Text Node with the given string

func SetPreText
func SetPreText(node dom.Node, text string) dom.Node

SetPreText does similar to SetInnerText, but linebreaks are converted to
s

func Text
func Text(text string) *dom.Text

Text creates a text node containing the givin text

Documentation

Overview

Package xjs provides some simple, but often needed shortcut funcs for gopherJS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(format string, params ...interface{})

Alert provides for formated alert boxes

func AppendChildren

func AppendChildren(parent dom.Node, children ...dom.Node) dom.Node

AppendChildren appends all the given children to the parent.

func Body

func Body() *dom.HTMLBodyElement

Body gets the document's body element

func CreateElement

func CreateElement(name string) dom.Element

CreateElement is a shortcut to create an element with the given name

func Log

func Log(format string, params ...interface{})

Log prints a formatted string to the javascript console

func RemoveChildren

func RemoveChildren(node dom.Node) dom.Node

RemoveChildren removes all of the child nodes of the node given

func SetInnerText

func SetInnerText(node dom.Node, text string) dom.Node

SetInnerText removes all child nodes from the given node and sets a single Text Node with the given string

func SetPreText

func SetPreText(node dom.Node, text string) dom.Node

SetPreText does similar to SetInnerText, but linebreaks are converted to <br />s

func Text

func Text(text string) *dom.Text

Text creates a text node containing the givin text

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL