adapted to changes in GopherJS API
updated JS