Comments on: Getting Data From the Wikipedia API Using jQuery https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/ Web Design, Themes, & Applications Thu, 03 May 2018 21:53:20 +0000 hourly 1 https://wordpress.org/?v=4.9.5 By: Eldon https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-243430 Thu, 03 May 2018 21:53:20 +0000 https://9bitstudios.com/?p=948#comment-243430 after the is suppose to div class article, but I put in in tags so it was removed.

]]>
By: Eldon https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-243429 Thu, 03 May 2018 21:52:17 +0000 https://9bitstudios.com/?p=948#comment-243429 Great tut, thanks for this. I have a request regarding the format this is calling. text&section=30 make sit easy to target specific sections within the wiki page, however, when we get to sections where information is presented in a table, the is blank. My question, is how we would revise this code so that a table section could be displayed? Thank you.

]]>
By: Theo https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-236007 Fri, 15 Sep 2017 20:11:50 +0000 https://9bitstudios.com/?p=948#comment-236007 Hi
Thank you for the post.
Links are working.
This is the idea:

//working links
blurb.find('a').each(function() {
var wikiAttr = $(this).attr('href');
var hash = "#";
var www ="www";
if(wikiAttr.indexOf(hash) === -1 && wikiAttr.indexOf(www) === -1){
$(this).attr('href', 'https://de.wikipedia.org' + wikiAttr).attr('title', 'https://de.wikipedia.org' + wikiAttr).attr('target', '_blank').addClass('myWikiLink');
}
if($(this).hasClass('external')){
$(this).attr('title', wikiAttr).attr('target', '_blank');
}
});

regards
theo

p.s.:you may have to alter css and inspect the wiki dom

]]>
By: py https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-235833 Mon, 04 Sep 2017 18:07:01 +0000 https://9bitstudios.com/?p=948#comment-235833 Merci Ian !
Lost in the ‘Random Quote Machine’ challenge of freecodecamp.org, your library saved me another day of errand.
With some modifications I have been able to produce an array filled with the gorgeous poetry of Guillevic (you may read those marvelous lines on this page (in french, sorry)) :
https://fr.wikiquote.org/wiki/Carnac
Thanks, thanks a lot !
py

]]>
By: anfelo https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-234456 Mon, 19 Jun 2017 23:46:24 +0000 https://9bitstudios.com/?p=948#comment-234456 Hi Ian, thanks alot! This help me to get started with javaScript ajax requests and MediaWiki. I also wanted to get a json object containing a list of articles that matched my entry, I found this helpful link:

https://stackoverflow.com/questions/25891076/wikipedia-api-fulltext-search-to-return-articles-with-title-snippet-and-image/25911756#25911756?newreg=8e78222a30d6428c901acb10baf70667

]]>
By: iCricket https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-234404 Fri, 16 Jun 2017 02:37:53 +0000 https://9bitstudios.com/?p=948#comment-234404 Just remove &section=0 from the url.

@Ian thanks alot mate! your “markup” variable has saved life.
was struggle to cast the content because of this “*”.

anyway how about this? I’ve a prob to catch the content because “number”

https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&titles=Nest

]]>
By: Ian https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-231513 Wed, 18 Jan 2017 00:38:30 +0000 https://9bitstudios.com/?p=948#comment-231513 Hi there Rosa — As far as I am aware, you would probably have to loop through the sections via multiple requests.

]]>
By: Rosa https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-231446 Tue, 17 Jan 2017 04:27:28 +0000 https://9bitstudios.com/?p=948#comment-231446 How can i display all sections?

]]>
By: Ian https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-231237 Mon, 19 Dec 2016 01:22:47 +0000 https://9bitstudios.com/?p=948#comment-231237 As things are implemented right now in the callback after the data loads you would have to replace all the links in the container that the Wikipedia data is loaded into with a link to a second page or page that ran the plugin on load off of some parameters or something.

]]>
By: Chuck https://9bitstudios.com/2014/03/getting-data-from-the-wikipedia-api-using-jquery/#comment-230891 Fri, 16 Dec 2016 21:49:16 +0000 https://9bitstudios.com/?p=948#comment-230891 great work! I appreciate it. Is there anyway to get this to work with the links working inside of the blurb to where it opens the next page in “blurb” format as well? Thanks!

]]>