XMLHttpRequest Access Denied with AngularJS on any IE version below 10

前端 未结 3 1238
我寻月下人不归
我寻月下人不归 2020-12-02 07:14

While viewing my application on any Microsoft IE browser of version earlier than 10, I get the following weird error at the console:

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 07:52

    In my case the Response Headers contained

    Content-Type:application/json; charset=UTF-8

    and this is an issue for IE9, since it cannot properly handle/parse JSON Objects in responses.

    Switching Response Headers to

    Content-Type:text/plain; charset=UTF-8

    In addition, make sure to have the following module included for IE9: https://stackoverflow.com/a/28905072/1202371

    allowed to receive the response in text and then convert it to JSON object.

提交回复
热议问题