$getJSON and for loop issue

That’s a classical problem : i has the value of end of loop when the callback is called. You can fix it like this : for (var i = 0; i < array.length; i++) { (function(i) { // protects i in an immediately called function $.getJSON(‘/api.php?action=query&list=querypage&qppage=” + array[i] + “&format=json’, function (data) { $(‘#’ + … Read more

How can I retrieve Wiktionary word content?

The Wiktionary API can be used to query whether or not a word exists. Examples for existing and non-existing pages: http://en.wiktionary.org/w/api.php?action=query&titles=test http://en.wiktionary.org/w/api.php?action=query&titles=testx The first link provides examples on other types of formats that might be easier to parse. To retrieve the word’s data in a small XHTML format (should more than existence be required), request … Read more

How to use wikipedia api if it exists? [closed]

You really really need to spend some time reading the documentation, as this took me a moment to look and click on the link to fix it. :/ but out of sympathy i’ll provide you a link that maybe you can learn to use. http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=New_York_Yankees&rvprop=timestamp|user|comment|content That’s the variabled you will be looking to get. Your … Read more