I have tried every combination I could find on here and the Wikimedia API site, still I can't seem to get any data returned. This is my code,
$('#go').click(function () {
var str = $("#input").val();
var fullstr = 'https://en.wikipedia.org/w/api.php?format=json&action=query&list=search&srnamespace=0&srsearch=' + str + '&srprop=snippet&format=json&callback=json';
$.getJSON(fullstr, function(data) {
alert(data);
});
});
I have tested it up until the getJSON call and it seems to be working, but I don't seem to be getting anything from the call. (The final alert() is just to check for any object being returned).
What is the problem?
Thanks!