2014-10-14
RAD Firefox InvalidStateError
どーもこんちわ。Firefoxだとこんな風に怒られて動かない。
InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable djbudo.hatenablog.com:289http://djbudo.hatenablog.com/
適当に考えた結果、responseType
の設定タイミングっぽい気がする。今のがこうなんだけど、
xhr.onload = function (e) { // ... }; xhr.responseType = 'document'; // XXX xhr.open(/* ... */); xhr.send(null);
open
した後かなーという気がするので、
xhr.onload = function (e) { // ... }; xhr.open(/* ... */); xhr.responseType = 'document'; // xhr.send(null);
これで動くかもしれない。
もしくは、タイミングの問題があって、
When set: throws an "InvalidStateError" exception if the state is LOADING or DONE.
http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute
こっちかも。
ナナメ読み
- javascript - Setting XMLHttpRequest.responseType forbidden all of a sudden? - Stack Overflow
- XMLHttpRequest Level 1 - World Wide Web Consortium (W3C)
- XMLHttpRequest Level 2 - World Wide Web Consortium (W3C)
- no title
〆
FYI id:yuta25
トラックバック - http://ptech.g.hatena.ne.jp/noromanba/20141014
Copyright (c) noromanba 2012-2018
ありがとうございますー感謝です!
対応ありがとうございます。Linux+Firefoxで動きました。机上デバッグたまに役に立つなぁ