I’m having trouble getting data from my getJSON call on my Wikipedia viewer. The link takes me to the data I want when I paste it in a ne window, if I mess with the link I get the fail alert, but otherwise nothing is showing up in the console whether I try to log the data or just a word. Can anyone help? This is what I have:
$(document).ready(function() {
$(“form”).submit(function() {
var input = $("#wikisearch").val();
var link = “https://en.wikipedia.org/w/api.php?action=opensearch&format=json&origin=*&search="+input+"&limit=5&callback=%3F”;
$.getJSON(link, function(data) {
$.fail(alert(“Try again”));
console.log(data);
});