From ab2b884c49825c243ae87d480d91913823fa5e22 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 3 Jan 2015 18:40:01 +0900 Subject: [PATCH] Bug fix: responseType must be set after opening --- ebitenutil/loadimage_js.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebitenutil/loadimage_js.go b/ebitenutil/loadimage_js.go index 764dc4c61..bd5e863b2 100644 --- a/ebitenutil/loadimage_js.go +++ b/ebitenutil/loadimage_js.go @@ -30,8 +30,8 @@ func NewImageFromFile(path string, filter ebiten.Filter) (*ebiten.Image, image.I var content js.Object ch := make(chan struct{}) req := js.Global.Get("XMLHttpRequest").New() - req.Set("responseType", "arraybuffer") req.Call("open", "GET", path, true) + req.Set("responseType", "arraybuffer") req.Set("onload", func() { defer close(ch) status := req.Get("status").Int()