Why does setting XMLHttpRequest responseType before calling open throw?

后端 未结 2 1040
夕颜
夕颜 2020-12-30 01:40

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

2条回答
  •  感情败类
    2020-12-30 02:19

    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.

提交回复
热议问题