I have an HTML page where I put city image. I want to load the main image of city from Wikipedia using jquery or php.
I tried using jquery with ajax but it loads all images i just want to load main image
$.ajax({ url: "https://en.wikipedia.org/w/api.php", data: { format: "json", action: "parse", page: "Mumbai", prop:"text", section:0, }, dataType: 'jsonp', success: function (data) { console.log(data) var markup = data.parse.text["*"]; var i = $('<div></div>').html(markup); $('#article').html($(i).find('img')); } });
How can i do it.
Thanks