Documentation ¶
Index ¶
- Variables
- func AddEventListener(obj *js.Object, event string, listener func(event *js.Object), ...)
- func AddEventListenerByClass(class string, event string, listener func(event *js.Object), ...)
- func AddEventListenerByID(id string, event string, listener func(event *js.Object), args ...interface{})
- func AddEventListenerDOMContentLoaded(callback func())
- func AddEventListenerLoad(callback func())
- func AddOnPopState(callback func(event *js.Object))
- func Alert(s string)
- func AppendChild(parent, node *js.Object)
- func AttributeRemove(node *js.Object, attr string) *js.Object
- func AttributeSet(node *js.Object, attr string, value string) *js.Object
- func AttributeSetNS(node *js.Object, namespace string, attr string, value string) *js.Object
- func ClassAddToList(node *js.Object, class string) *js.Object
- func ClassRemoveFromList(node *js.Object, class string) *js.Object
- func ConsoleError(args ...interface{})
- func ConsoleInfo(args ...interface{})
- func ConsoleLog(args ...interface{})
- func ConsoleWarn(args ...interface{})
- func CreateElement(name string) *js.Object
- func CreateTextNode(text string) *js.Object
- func DocumentSetTitle(title string)
- func GetAttribute(node *js.Object, attr string) string
- func GetConsole() *js.Object
- func GetElementByID(id string) *js.Object
- func GetElementsByClassName(class string) []*js.Object
- func GetHistory() *js.Object
- func GetLocation() *js.Object
- func GetQuerySelector(selector string) *js.Object
- func GetQuerySelectorAll(selector string) *js.Object
- func GetStateOfOnPopState(event *js.Object) interface{}
- func GetTargetOfEventListener(event *js.Object) *js.Object
- func GetValueString(node *js.Object) string
- func HistoryPushState(state interface{}, url string)
- func HistoryReplaceState(state interface{}, url string)
- func LocationGetHash() string
- func LocationGetHost() string
- func LocationGetHostname() string
- func LocationGetHref() string
- func LocationGetOrigin() string
- func LocationGetPathname() string
- func LocationGetPort() string
- func LocationGetProtocol() string
- func LocationGetSearch() string
- func LocationReload(forcedReload ...bool)
- func LocationSetHref(href string)
- func NewURL(url string) *js.Object
- func RemoveAllChild(node *js.Object)
- func RemoveChild(parent, node *js.Object)
- func RemoveEventListener(obj *js.Object, event string, listener func(event *js.Object), ...)
- func RemoveEventListenerByClass(class string, event string, listener func(event *js.Object), ...)
- func RemoveEventListenerByID(id string, event string, listener func(event *js.Object), args ...interface{})
- func SetValueString(node *js.Object, value string)
- func TextContentGet(node *js.Object) string
- func TextContentSet(node *js.Object, text string) *js.Object
- func URLAppendQueryParam(param string, value string)
- func URLSearchParamsGet(param string) string
Constants ¶
This section is empty.
Variables ¶
var ( // Window is a window js Object Window = js.Global // Document is a DOM of the page Document = js.Global.Get("document") )
Functions ¶
func AddEventListener ¶
func AddEventListener(obj *js.Object, event string, listener func(event *js.Object), args ...interface{})
AddEventListener sets up a function that will be called whenever the specified event is delivered to the target
func AddEventListenerByClass ¶
func AddEventListenerByClass(class string, event string, listener func(event *js.Object), args ...interface{})
AddEventListenerByClass adds listener to elements with class name
func AddEventListenerByID ¶
func AddEventListenerByID(id string, event string, listener func(event *js.Object), args ...interface{})
AddEventListenerByID adds listener to element with ID
func AddEventListenerDOMContentLoaded ¶
func AddEventListenerDOMContentLoaded(callback func())
AddEventListenerDOMContentLoaded calls func when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading
func AddEventListenerLoad ¶
func AddEventListenerLoad(callback func())
AddEventListenerLoad is fired when the whole page has loaded, including all dependent resources such as stylesheets images.
func AddOnPopState ¶
AddOnPopState calls callback each time the active history entry changes between two history entries for the same document. HistoryPushState or HistoryReplaceState won't trigger AddOnPopState
func AppendChild ¶
AppendChild adds a node to the end of the list of children of a specified parent node
func AttributeRemove ¶
AttributeRemove removes the attribute with the specified name
func AttributeSet ¶
AttributeSet sets attribute and its value to the node
func AttributeSetNS ¶
AttributeSetNS sets attribute with name space and its value to the node
func ClassAddToList ¶
ClassAddToList adds class name to the class list of the node
func ClassRemoveFromList ¶
ClassRemoveFromList removes class name from class list of the node
func ConsoleError ¶
func ConsoleError(args ...interface{})
ConsoleError outputs an error message to the Web Console.
func ConsoleInfo ¶
func ConsoleInfo(args ...interface{})
ConsoleInfo outputs an informational message to the Web Console.
func ConsoleLog ¶
func ConsoleLog(args ...interface{})
ConsoleLog outputs a message to the Web Console.
func ConsoleWarn ¶
func ConsoleWarn(args ...interface{})
ConsoleWarn outputs a warning message to the Web Console.
func CreateElement ¶
CreateElement creates the HTML element specified by tagName
func CreateTextNode ¶
CreateTextNode creates a new Text node
func GetAttribute ¶
GetAttribute returns value of the node attribute
func GetElementByID ¶
GetElementByID returns element by ID
func GetElementsByClassName ¶
GetElementsByClassName returns list of the elements by class name
func GetQuerySelector ¶
GetQuerySelector returns the first Element within the document that matches the specified selector, or group of selectors
func GetQuerySelectorAll ¶
GetQuerySelectorAll returns a static (not live) NodeList representing a list of the document's elements that match the specified group of selectors
func GetStateOfOnPopState ¶
GetStateOfOnPopState returns state of the event in callback onpopstate state sets in HistoryPushState or HistoryReplaceState methods
func GetTargetOfEventListener ¶
GetTargetOfEventListener returns target of the event listener
func GetValueString ¶
GetValueString returns string value of the js Node
func HistoryPushState ¶
func HistoryPushState(state interface{}, url string)
HistoryPushState will cause the URL bar to display URL, but won't cause the browser to load URL or even check that URL exists. The parameter Title is ignored by browsers and is not taken here as an argument.
func HistoryReplaceState ¶
func HistoryReplaceState(state interface{}, url string)
HistoryReplaceState operates exactly like HistoryPushState except that it modifies the current history entry instead of creating a new one. The parameter Title is ignored by browsers and is not taken here as an argument.
func LocationGetHash ¶
func LocationGetHash() string
LocationGetHash returns string containing a '#' followed by the fragment identifier of the URL.
func LocationGetHost ¶
func LocationGetHost() string
LocationGetHost returns string containing the host, that is the hostname, a ':', and the port of the URL.
func LocationGetHostname ¶
func LocationGetHostname() string
LocationGetHostname returns string containing the domain of the URL
func LocationGetHref ¶
func LocationGetHref() string
LocationGetHref returns string containing the entire URL
func LocationGetOrigin ¶
func LocationGetOrigin() string
LocationGetOrigin returns string containing the canonical form of the origin of the specific location.
func LocationGetPathname ¶
func LocationGetPathname() string
LocationGetPathname returns string containing an initial '/' followed by the path of the URL.
func LocationGetPort ¶
func LocationGetPort() string
LocationGetPort returns string containing the port number of the URL
func LocationGetProtocol ¶
func LocationGetProtocol() string
LocationGetProtocol returns string containing the protocol scheme of the URL including the final ':', example 'http:' or 'https:'
func LocationGetSearch ¶
func LocationGetSearch() string
LocationGetSearch returns string containing a '?' followed by the parameters or "querystring" of the URL.
func LocationReload ¶
func LocationReload(forcedReload ...bool)
LocationReload reloads the current resource, like the Refresh button. It has an optional Boolean parameter, which is false by default. If true, the page is always reloaded from the server, ignoring the browser cache.
func LocationSetHref ¶
func LocationSetHref(href string)
LocationSetHref sets href and associated document navigates to the new page
func RemoveAllChild ¶
RemoveAllChild remove every child of the node
func RemoveChild ¶
RemoveChild removes a child node from the DOM
func RemoveEventListener ¶
func RemoveEventListener(obj *js.Object, event string, listener func(event *js.Object), args ...interface{})
RemoveEventListener removes from the element an event listener previously registered with addEventListener
func RemoveEventListenerByClass ¶
func RemoveEventListenerByClass(class string, event string, listener func(event *js.Object), args ...interface{})
RemoveEventListenerByClass removes listener from elements with class name
func RemoveEventListenerByID ¶
func RemoveEventListenerByID(id string, event string, listener func(event *js.Object), args ...interface{})
RemoveEventListenerByID removes listener from element with ID
func SetValueString ¶
SetValueString sets string value to attribute of the node
func TextContentGet ¶
TextContentGet returns text content of the node
func TextContentSet ¶
TextContentSet sets text content of the node
func URLAppendQueryParam ¶
URLAppendQueryParam appends Query Param to current URL
func URLSearchParamsGet ¶
URLSearchParamsGet returns value of the param of the current URL
Types ¶
This section is empty.