Testing Flickr's JSON Feed

*** Update *** This issue has been resolved. This page is left as-is for testing and historical purposes. As such, the claims made are no longer current. You can test this for yourself with the buttons below. Thanks, Flickr!

This demo page is set up to test Flickr's JSON feed, as part of my FlickrFont project. There is a problem with the feed under IE. I've let Flickr know about it, so I hope to hear back from them soon.

The JSON object literal returned by Flickr is not compliant with the standard. Mozilla's FireFox handles it okay, but Microsoft's Internet Explorer chokes on it. You can test this yourself by visiting this page with both browsers and comparing their different behaviour. MSIE reports an error on page ie "expected identified, string or number".

How Do I Test This?

Please select a JSON object by clicking the buttons. You should see a pop-up window saying "in getJSON" and another saying "in callback" before the title of the feed is written out below. You'll only get both pop-ups in FireFox; IE will show the first but will fail on the callback. To see this yourself, first click the "raw" button. This gets the live JSON feed from Flickr using the URL http://www.flickr.com/services/feeds/photos_public.gne?tags=punctuation,atsign&format=json.Next, click the "correct" button. This gets the same object except it has been "corrected" by removing the trailing commas from the nested item objects.


     

No results



What's Going On?

Well, JSON support is presently unofficial, so there's the odd lingering bug. What's happening is that the JSON object returned by Flickr has a small formatting problem that causes IE to baulk, while FF takes it in its stride. This problem is that, for each photo returned, a bunch of fields get passed back in a nested "item" list: title, link, description, published, author and tags. These are separated by commas (as they should be) but for some reason, there is a superfluous trailing comma after the tags data. Conceptually, it's like this: {a, b, c, d, e,} instead of {a, b, c, d, e}. Get it?

Can I See An Example?

Sure. Here's one. The errant comma is the fifth last symbol on the left column.

Raw Flickr Feed

Corrected Flickr Feed

jsonFlickrFeed({ title: "punctuation and atsign - Everyone's Tagged Photos", link: "http://www.flickr.com/photos/", description: "A feed of punctuation and atsign - Everyone's Tagged Photos", modified: "2005-08-11T21:58:09Z", generator: "http://www.flickr.com/", items: [ { title: "atsign", link: "http://www.flickr.com/photos/bip/33246844/", description: "<p><a href="http://www.flickr.com/people/bip/">Claudecf</a> posted a photo:</p> <p><a href="http://www.flickr.com/photos/bip/33246844/" title="atsign"><img src="http://static.flickr.com/23/33246844_a4bfffcd2e_m.jpg" width="240" height="225" alt="atsign" style="border: 1px solid #ddd;" /></a></p> ", published: "2005-08-11T21:58:09Z", author: "nobody@flickr.com (Claudecf)", tags: "blue claudecf punctuation atsign", } ] })

jsonFlickrFeed({ title: "punctuation and atsign - Everyone's Tagged Photos", link: "http://www.flickr.com/photos/", description: "A feed of punctuation and atsign - Everyone's Tagged Photos", modified: "2005-08-11T21:58:09Z", generator: "http://www.flickr.com/", items: [ { title: "atsign", link: "http://www.flickr.com/photos/bip/33246844/", description: "<p><a href="http://www.flickr.com/people/bip/">Claudecf</a> posted a photo:</p> <p><a href="http://www.flickr.com/photos/bip/33246844/" title="atsign"><img src="http://static.flickr.com/23/33246844_a4bfffcd2e_m.jpg" width="240" height="225" alt="atsign" style="border: 1px solid #ddd;" /></a></p> ", published: "2005-08-11T21:58:09Z", author: "nobody@flickr.com (Claudecf)", tags: "blue claudecf punctuation atsign" } ] })


Get Firefox