Bug fix: responseType must be set after opening

This commit is contained in:
Hajime Hoshi 2015-01-03 18:40:01 +09:00
parent 2eea1afcd1
commit ab2b884c49

View File

@ -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()