I'm parsing JSON data from an external url but failing to use the data because of an 'Uncaught SyntaxError: Unexpected token :' syntax error. I checked the JSON on JSONLint and it validated okay so I don't know what I could be doing wrong.
I'm getting it from this URL:
Parsing it like so:
$.getJSON("http://clipped.me/algorithm/clippedapi.php?url=http://www.bbc.com/news/world-asia-china-30067035&callback=?", function(data) {
var story = data.summary[0];
console.log(story);
$('p').html(story)
});
And the data received is this:
{
"title": "BBC News - Hong Kong protest leaders denied Beijing flight",
"summary": [
"They had hoped to meet China's leaders as part of their push for greater democracy, but were told at the airport that their travel permits were invalid.",
"They want Beijing to allow more candidates to stand in the territory's next leadership election in 2017.",
"The group were greeted at the airport by fellow democracy activists, who unfurled yellow umbrellas - a symbol of Hong Kong's democracy movement."
],
"source": "bbc.com"
}
Here is a JSFIDDLE example.