htaccess 有没有办法确保我的 json 标头正确?
更新:有人发现这些 json 标头有什么问题吗?
Date Mon, 26 Jul 2010 08:31:11 GMT
Server Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.7a mod_fcgid/2.3.5 Phusion_Passenger/2.2.15 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By PHP/5.2.13
X-Pingback http://brettbarros.com/wordpress/xmlrpc.php
Content-Disposition attachment; filename="json_api.json"
Vary Accept-Encoding
Content-Encoding gzip
Content-Length 719
Keep-Alive timeout=5, max=98
Connection Keep-Alive
Content-Type application/json; charset=UTF-8
具体来说,它可以在 ie8、ffx、chrome 中使用 jquery 的 getJSON,但不能在 ie7 或 ie6 中使用...
AddType application/json .json
是一个简单的方法来让你的一切*.json
使用正确的 MIME 类型发送的文件。当然,如果您在 PHP 脚本之类的东西中动态创建它们,那是行不通的。在这种情况下,您可以在脚本中添加信息:
<?php
header('Content-Type: application/json');
// ...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)