views:

176

answers:

1

Why am I getting an error in my json use in ie6 and ie7, but no other browser?

I'm parsing with:

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

I'm parsing a json feed from the wordpress plugin JSON API: http://wordpress.org/extend/plugins/json-api/other_notes/

You can view a test / error here: http://brettbarros.com/ietest.html

Edit 2: It appears that "data" is null. I have no idea why.

Edit 3: Here are my headers... anyone see any problems with them? If so, how would I fix it?

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  A: 

seams that the Javascript engine doesn't see a url property in the attachment. So if you expect a url property there and this only doesn't work in IE6 and IE7 the execution off the JSON request doesn't go well. Maybe the parameters are not correct or id isn't a good value in the browsers?

Where is id being set?

Do you debug the JSON request to see if in each browser id is set?

maybe you can give more information?

michel
I'm not sure, but I think it might have something to do with the actual json file that I'm calling or how I'm calling it? Does ie6/7 need a .js ending or something?
Matrym
I've added a url for you to test
Matrym
Just put an alert(id) before the $.getJSON( to see if id is set. I think setting the id is the problem. Handling the JSON-request is doing serversided... And that doesn't seems to give any problems. I get a good response over here
michel
Thanks michael, but I even tried hardcoding the id and it's still no good.
Matrym
Aha! It was a combination of subdomain www having cross domain issues *and* id being wrong. Thanks a billion :)
Matrym
great. success!
michel