Quantcast
Channel: JSON object is null, even though feed is valid JSON - Stack Overflow
Viewing all articles
Browse latest Browse all 6

JSON object is null, even though feed is valid JSON

$
0
0

Help, I'm confused.
I just need to get a JSON object into my page. The URL is as follows:

http://disqus.com/api/get_forum_posts/?user_api_key=MYKEY&forum_id=MYID&api_version=1.1

If I use the Flickr API URL and the code given in the getJSON example, it works fine:

<script>$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?",        function(data){          alert(data);          $.each(data.items, function(i,item){            $("<img/>").attr("src", item.media.m).appendTo("#images");            if ( i == 3 ) return false;          });        });</script>

But, if I substitute in the Disqus URL above, the data is null. After reading JSON Feed Returning null while using jQuery getJSON I checked whether this URL returned valid JSON, and it does.

The Disqus API seems to suggest it supports JSONP - 'You can also pass "jsonp:callback" as the "api_response_format" parameter'. I've tried adding this parameter, but it doesn't help.

What am I doing wrong? I suspect the problem may be that I don't really understand the difference between JSON and JSONP, and what I need to be doing to get JSONP back.


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images