Currently, I am working on a hybrid mobile application using Angular. I have a string that is obtained from a $http.jsonp request and I am attempting to convert the response into JSON format. After checking the validity of the JSON at , it appears to be valid.
The issue arises when I encounter an error in the Chrome web console stating "Uncaught Syntax Error: Unexpected token :". I am struggling to understand why this error is occurring despite having verified the JSON formatting. Below is the server response, can someone assist me in identifying the problem?
{
"rss":{
"version":"2.0",
"xmlns:content":"http://purl.org/rss/1.0/modules/content/",
"xmlns:wfw":"http://wellformedweb.org/CommentAPI/",
"xmlns:dc":"http://purl.org/dc/elements/1.1/",
"xmlns:atom":"http://www.w3.org/2005/Atom",
"xmlns:sy":"http://purl.org/rss/1.0/modules/syndication/",
"xmlns:slash":"http://purl.org/rss/1.0/modules/slash/",
"channel":{
"title":"WEBSITE TITLE",
"link":[
{
"href":"https://www.WEBURL.com/feed/",
"rel":"self",
"type":"application/rss+xml"
},
"https://www.WEBURL.com"
],
"description":"WEB DESCRIPTION",
"lastBuildDate":"Fri, 25 Sep 2015 16:33:52 +0000",
"language":"en-US",
"updatePeriod":"hourly",
"updateFrequency":"1",
"generator":"http://wordpress.org/?v=4.3",
"item":[
{
"title":"TITLE",
"link":"https://www.WEBURL.com/2015/09/25/POST",
"comments":[
"https://www.WEBURL.com/2015/09/25/POST/#comments",
"0"
],
"pubDate":"Fri, 25 Sep 2015 16:27:19 +0000",
"creator":"AUTHOR",
"category":"CATEGORY",
"guid":"https://www.WEBURL.com/?p=12345",
"description":"<p>POST DESCRIPTION</p>\n",
"encoded":"<p class=\"article-content__figure article-content--image\">POST CONTENT</p>\n",
"commentRss":"https://www.WEBURL.com/2015/09/25/POST/feed/"
}
]
}
}
}
Below is the Javascript code snippet:
$http.jsonp("http://jsonburner.herokuapp.com/source?feed=https://www.WEBURL.com/feed/")
.success(function(data) {
$scope.debug = data.rss.version
//$scope.debug = data.rss.version
})
.error(function(data) {
$scope.debug = data
//$scope.debug = data.rss.version
});
Thank you,
Alex