I can't get the following lines of code to return JSON, or even to run my simple alert() function embedded inside. I know the URL is correct, because when I paste it in the browser it returns JSON. Does anyone know what could be the problem here?
I've tried this in CodePen and JSFiddle (making sure to include jQuery) on Chrome, but no such luck.
$.getJSON("https://en.wikipedia.org/w/api.php?action=query&prop=info&format=json&callback=?inprop=url&pageids=18630637"
, function(data) {
alert("success");
console.log(data);
});