代码之家  ›  专栏  ›  技术社区  ›  Matrym

json在ie6、ie7(而不是ie8、ff、ch)中表示“xxx为空或不是对象”

  •  1
  • Matrym  · 技术社区  · 15 年前

    为什么在IE6和IE7中使用JSON时出错,但没有其他浏览器?

    我正在分析:

    $.getJSON('http://www.brettbarros.com/wordpress/?post_type=projects&json=get_post&include=title,content,attachments&post_id=8', function(data) {
        alert(data);
    });
    

    我正在分析WordPress插件JSON API中的JSON源: http://wordpress.org/extend/plugins/json-api/other_notes/

    您可以在此处查看测试/错误: http://brettbarros.com/ietest.html

    编辑2:“数据”为空。我不知道为什么。

    编辑3:这是我的标题…有人看到他们有什么问题吗?如果是这样,我该如何修复它?

    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
    
    1 回复  |  直到 15 年前
        1
  •  1
  •   Michel    15 年前

    javascript引擎在附件中看不到URL属性的接缝。因此,如果您希望在这里有一个URL属性,而这只在IE6和IE7中不起作用,那么JSON请求的执行就不太好。可能参数不正确或 id 浏览器的价值不是很高吗?

    在哪里 身份证件 被设定?

    是否调试JSON请求以查看是否在每个浏览器中 身份证件 设定好了吗?

    也许你能提供更多的信息?