【问题标题】:JSON compatibility Issue with Internet Explorer 9Internet Explorer 9 的 JSON 兼容性问题
【发布时间】:2011-09-13 06:28:38
【问题描述】:

在 Google Chrome 中获取 JSON 数据可以正常工作,但在 Internet Explorer 9 中,浏览器会显示以下内容:

您要打开还是保存文件?

我该如何纠正这个问题?

【问题讨论】:

标签: json internet-explorer-9


【解决方案1】:

服务器是否设置了Content-Type-header?例如。

Content-Type: application/json

浏览器通常知道application/json(如text/html 等)不是用于下载,而是用于浏览器本身。

如果你不设置它,broser可能会认为它只是一个纯文本文件,并将其作为下载提供给用户。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2012-12-11
  • 2014-02-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-10-06
  • 1970-01-01
相关资源
最近更新 更多