SwitchUp SwitchUp Ranked Best Coding Bootcamps 2025

Need help with my Wikipedia viewer

Altcademy Team wrote on 7 February 2018

I am making the getJSON call and it never seems to get to the callback function - what am I doing wrong? I never see the text "json call was made"

$(document).ready(function(){ $( "#titleText" ).change(function() { var str = "Input handled was "+ $( this ).val(); console.log( str); var searchURL = "https://en.wikipedia.org/w/api.php?format=json&action=query&titles="+$( this ).val()+"&prop=revisions&rvprop=content&callback=?"; console.log ("Calling getjson with "+ searchURL); $.getJSON(searchURL ,function(data) { console.log("jason call was made"); }); console.log("After the json call, at the end of the event handler"); });

Hey, I created a test of your code on repl.it and it seems to be working. Did you require jQuery properly in the HTML <head> tag? you can check out the working code here https://repl.it/EH6B/0

Trusted by

Students and instructors from world-class organizations

Join the upcoming Cohort #111

Enroll for March 2nd, 2026