Reputation: 61
I have below Json output
{ "IDsInThisList":"28184,28181,28180,28178","RowsReturned":"4","List" :[{"ContentID":28184,"ArticleType":"News","Headline":"Mobile Bytes","Article":"<p>HTC CFO Chialin Chang expects the manufacturer’s fortunes to change for the better going in to 2014.</p>"}]}
I need to get "Headline" out and display it using jquery template, i normally uses {{:Headline}} but for somereason its not working, possibly because its inside "List", how to i render "Headline" out?
Upvotes: 0
Views: 53
Reputation: 115282
Parse the string using JSON.parse()
then access using a.List[0].Headline
var a=JSON.parse('{ "IDsInThisList":"28184,28181,28180,28178","RowsReturned":"4","List" :[{"ContentID":28184,"ArticleType":"News","Headline":"Mobile Bytes","Article":"<p>HTC CFO Chialin Chang expects the manufacturer’s fortunes to change for the better going in to 2014.</p>"}]}');
console.log(a.List[0].Headline);
Upvotes: 3