i getting below json return wiki:
{ "query": { "pages": { "1514": { "pageid": 1514, "ns": 0, "title": "exampletitle", "extract": "example extract" } } } }
how can access "extract" value json? not know page id (1514) , can't json.query.pages.1514.extract;
(anyway .1514 not work)
thank you!
you can iterate on pages object access members
for(var key in json.query.pages){ if(json.query.pages.hasownproperty(key)){ console.log(json.query.pages[key].extract); } }
Comments
Post a Comment