onload

package module
v0.0.0-...-df05696 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2017 License: MIT Imports: 1 Imported by: 0

README

GoDoc

onload is a very simple module, designed to provide cross-browser, jQuery-like onload functionality without the bloat of jQuery. It is writen entirely in Go. To use it:

package main

import (
    "fmt"
    "github.com/flimzy/onload"
)

func main() {
    onload.Ready( func() {
        fmt.Print("The document is ready!\n")
    })
}

This code is based on this StackOverflow answer, but somewhat simplified, and of course adapted to Go.

This software is released under the terms of the MIT license. See LICENSE.txt for details.

Documentation

Rendered for js/wasm

Overview

Package onload provides a minimal, cross-browser document onload trigger for GopherJS. It is adapted from http://stackoverflow.com/a/9899701/13860

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ready

func Ready(fn func())

Ready registers a function to fire when the page is loaded. This is effectively the same as jQuery's $.ready(), but written in Go, and without the bloat of jQuery. Ready() may be called multiple times, and once the document is ready, registered functions will be called in registration order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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