require

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustRequire

func MustRequire(path string)

MustRequire is the same as Require, but panics on an error.

func MustRequireValue

func MustRequireValue(name, path string) js.Value

MustRequireValue loads a specified file and returns a global value with a given name.

func Require

func Require(path string) error

Require adds a specified file (js or css) into the document and waits for it to load.

The function relies on a file extension to detect the type. If there is no extension in the file path, use specific function like Stylesheet or Script. As an alternative, append a '#.js' or '#.css' suffix to a file path.

func RequireLazy

func RequireLazy(path string) func() error

RequireLazy is the same as Require, but returns a function that will load the file on the first call.

func Script

func Script(path string) error

Script adds a specified JS file into the document and waits for it to load.

func Stylesheet

func Stylesheet(path string) error

Stylesheet add a specified CSS file into the document and waits for it to load.

func StylesheetString

func StylesheetString(data string)

StylesheetString loads a CSS stylesheet string into the DOM.

Types

This section is empty.

Jump to

Keyboard shortcuts

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