当打开JSON页面时,Chrome、Firefox等浏览器可以直接浏览,IE则是弹出保存对话框:
代码如下 |
复制代码 |
<%
Response.ContentType = "application/json"
Response.Write("{""page"":""test.asp""}")
%>
|
IE浏览JSON时弹出保存对话框解决方法
将下边内容粘贴到记事本,保存为json-ie.reg:
代码如下 |
复制代码 |
Windows Registry Editor Version 5.00;
; Tell IE 7,8,9,10,11 to open JSON documents in the browser on Windows XP and later.
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place" .
;
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=hex:08,00,00,00
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=hex:08,00,00,00
|
双击导入注册表,重新打开IE即可浏览JSON: