문제

Running new XMLHttpRequest().responseType = "json" in the console throws an "InvalidStateError" exception in Firefox 26 and IE11 but not in Chrome 31.

Why?

The Spec states that setting responseType

throws an "InvalidStateError" exception if the state is LOADING or DONE.

but in this case the state is UNSENT.

What's going on?

도움이 되었습니까?

해결책 2

It's a working draft, so it's normal if there are small differences or bugs in the implementations. I think Firefox still follows the behavior described in the draft of August 2011, where is specified that the exception is thrown if the state is not OPENED or HEADERS_RECEIVED.

다른 팁

Note that setting responseType after I call open on the xhr object solved my problem (using IE11)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top