adapted to gopherjs api changes
updated js