I am using JSON.parse() in java script to parse the json stream returned by the Rest api.
Here is the code that i have written:
var tweets = JSON.parse(httpResponse.text);
var Tweet = Parse.Object.extend(“TweetDB”);
var count = tweets.length;
if(count > 0)
for(var i = 0; i< count; i = i +1)
var tweet = new Tweet();
Now for the first tweet, i am able to extract the url successfully. But from the second tweet, i am unable to extract the url from the tweet and it throws an error.
Also, each tweet in the JSON stream had a URL and if I comment the code where i extract the url, it works fine.
Can somebody please throw some light on it.
Thanks in advance.