I'm trying to read Tumblr posts via the JSON API.
Using their API, data is passed back like this:
var tumblr_api_read= {
"posts":[
"id":"1234",
"regular-title":"This is the title of the post",
"regular-body":"This is the body of the post"
]
}
I'm having trouble returning "regular-title" and "regular-body".
My JS code looks like this:
var tumblr= tumblr_api_read['posts'];
for (eachPost in tumblr)
{
var id=posts[eachPost].id; //Works fine
var regularTitle=posts[eachPost].regular-title; //Returns NaN
}
I am assuming it is because posts[eachPost].regular-title has the dash in it but am not able to find any documentation on how to make it work in this situation!
Thanks.