SImple cross-browser onload (document ready) handler written in go for gopherjs.

Jonathan Hall df05696124 A couple small fixes 7 years ago
LICENSE.txt 883053bff3 initial commit 7 years ago 5b82b1d2f0 Add a little documentation 7 years ago
onload.go df05696124 A couple small fixes 7 years ago


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 (

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.