gopherjs: Recursion Error in Iceweasel 49, trying to run the gopherjs/jquery example in README.md

I tried to run the jquery example in gopherjs/jquery, in my Iceweasel 49 (Firefox), note I have NoScript and few privacy addons enabled (uBlock Origin, HTTPS Everywhere, etc.)…

Your current jQuery version is: 2.1.0
too much recursion <Learn More> main.js:int:int

go env (It may be useless):

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/gopath"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build875613271=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

Edit: Found out more after debugging:

It issues at main.js:2059:1, main.js is here: https://bpaste.net/raw/9652fed5cdcc

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 29 (9 by maintainers)

Most upvoted comments

package main

import "github.com/gopherjs/jquery"

//convenience:
var jQuery = jquery.NewJQuery

const (
    INPUT  = "input#name"
    OUTPUT = "span#output"
)

func main() {

    //show jQuery Version on console:
    print("Your current jQuery version is: " + jQuery().Jquery)

    //catch keyup events on input#name element:
    jQuery(INPUT).On(jquery.KEYUP, func(e jquery.Event) {

        name := jQuery(e.Target).Val()
        name = jquery.Trim(name)

        //show welcome message:
        if len(name) > 0 {
            jQuery(OUTPUT).SetText("Welcome to GopherJS, " + name + " !")
        } else {
            jQuery(OUTPUT).Empty()
        }
    })
}