I'm working in JavaScript and I have a json file with info from Twitter. I have no problem accesing it using something like: var content = data.text;
so I can use it to change a div
using innerHTML.
Now, I'm also trying to check if certain hashtag is present (to fire a video). Now, I have a variable called data
that using the .getJSON
method stores the info from the JSON file.
I can access properties like time_zone
easily using data.user.time_zone
but thing like the hashtags are inside an array of objects and I don't know how to acces, for instance the 'text'.
This is the '.json' (I edited some info because it was too long).
{
"user": {
"following": null,
},
"in_reply_to_screen_name": null,
"entities": {
"user_mentions": [],
"urls": [],
"trends": [],
"symbols": [],
"hashtags": [
{
"text": "fuego",
"indices": [
25,
31
]
},
{
"text": "primaLED",
"indices": [
32,
41
]
}
]
},
"contributors": null,
}
I found some "solutions" but none are working, I'm new to programing so I'm really lost.