Documentation ¶
Index ¶
- func Alert(s string)
- func CookieDelete(name string)
- func CookieGet(name string) (value string, ok bool)
- func CookieSet(name, value, path string, expires ...time.Time)
- func CookieSetString(cookie string)
- func IsCookieEnabled() bool
- type Console
- type History
- type Location
- func (l *Location) GetFullDomainPath() string
- func (l *Location) GetFullPath() string
- func (l *Location) GetHash() string
- func (l *Location) GetHost() string
- func (l *Location) GetHostname() string
- func (l *Location) GetHref() string
- func (l *Location) GetOrigin() string
- func (l *Location) GetPathname() string
- func (l *Location) GetPort() string
- func (l *Location) GetProtocol() string
- func (l *Location) GetSearch() string
- func (l *Location) Reload(forcedReload ...bool)
- func (l *Location) SetHref(href string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CookieGet ¶
CookieGet returns a given cookie by name. If the cookie is not set then ok will be set to false
func CookieSet ¶
CookieSet adds a cookie to a user's browser with a name, value, expiry and path value, path and expires can be omitted
Examples: Without path and expires: CookieSet("name", "value", "")
or with path and expires to next month: CookieSet("name", "value", "/", time.Now().AddDate(0, 1, 0))
func CookieSetString ¶
func CookieSetString(cookie string)
CookieSetString sets a cookie given a correctly formatted cookie string i.e "username=John Smith; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/"
func IsCookieEnabled ¶
func IsCookieEnabled() bool
IsCookieEnabled returns false if setting a cookie will be ignored and true otherwise.
Types ¶
type Console ¶
Console object
func (*Console) Error ¶
func (c *Console) Error(args ...interface{})
Error outputs an error message to the Web Console.
func (*Console) Info ¶
func (c *Console) Info(args ...interface{})
Info outputs an informational message to the Web Console.
type History ¶ added in v1.0.1
History object
func (*History) Back ¶ added in v1.0.1
func (h *History) Back()
Back moves to backward through history. This acts exactly as if the user clicked on the Back button in their browser toolbar.
func (*History) Forward ¶ added in v1.0.1
func (h *History) Forward()
Forward moves forward as if the user clicked the Forward button.
func (*History) Go ¶ added in v1.0.1
Go method loads a specific page from the session history. You can use it to move forwards and backwards through the history. -1 equivalent of calling Back()
1 just like calling Forward()
-2 or 2 backwards by two pages or forward two pages
0 will reload the current page
func (*History) PushState ¶ added in v1.0.1
PushState adds a state to the browser's session history stack. state - JavaScript object which is associated with the new history entry. title - most browsers currently ignores this parameter, although they may use it in the future. url - The new history entry's URL is given by this parameter. Note that the browser won't attempt to load this URL after a call to pushState(), but it might attempt to load the URL later, for instance after the user restarts the browser.
func (*History) PushURL ¶ added in v1.0.1
PushURL is a wrap pushState just to set url and add it to history
func (*History) ReplaceState ¶ added in v1.0.1
ReplaceState method modifies the current history entry, replacing it with the state, title, and URL passed in the method parameters. This method is particularly useful when you want to update the state object or URL of the current history entry in response to some user action.
func (*History) ReplaceURL ¶ added in v1.0.1
ReplaceURL is a wrap replaceState just to set new URL without adding it to history
type Location ¶
Location object allows you to get any parts of the URL and set href fragments. If you want to set new URL use History object
func (*Location) GetFullDomainPath ¶ added in v1.0.1
GetHostnameFullPath return full path with hostname and protocol
func (*Location) GetFullPath ¶ added in v1.0.1
GetFullPath is just wrap to get current full path without host like a 'path?query=param#fragment' in the root path will be '/'
func (*Location) GetHash ¶
GetHash returns string containing a '#' followed by the fragment identifier of the URL.
func (*Location) GetHost ¶
GetHost returns string containing the host, that is the hostname, a ':', and the port of the URL.
func (*Location) GetHostname ¶
GetHostname returns string containing the domain of the URL
func (*Location) GetOrigin ¶
GetOrigin returns string containing the canonical form of the origin of the specific location.
func (*Location) GetPathname ¶
GetPathname returns string containing an initial '/' followed by the path of the URL.
func (*Location) GetProtocol ¶
GetProtocol returns string containing the protocol scheme of the URL including the final ':', example 'http:' or 'https:'
func (*Location) GetSearch ¶
GetSearch returns string containing a '?' followed by the parameters or "querystring" of the URL.