json - JavaScript extract certain data from Wikipeida API -


how extract highlighted(in green) data wikipedia api , display on front-end. want separate value , display separately in front-end.

enter image description here

function getjsonp(url, success) {      var ud = '_' + +new date,          script = document.createelement('script'),          head = document.getelementsbytagname('head')[0] || document.documentelement;        window[ud] = function(data) {          head.removechild(script);          success && success(data);      };        script.src = url.replace('callback=?', 'callback=' + ud);      head.appendchild(script);    }  getjsonp('http://en.wikipedia.org/w/api.php?format=json&action=query&titles=list_of_metropolitan_areas_by_population&prop=revisions&rvprop=content&callback=?', function(data){      console.log(data);      document.getelementbyid("title").innerhtml = data.query.pages[125279].title;            var incontent = data.query.pages[125279].revisions[0];      document.getelementbyid("con").innerhtml = incontent;  });  
<div id="title"></div>  <div id="con"></div>


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -