I want to display my JSON object from an AJAX call to an external API. Though I'm new to JavaScript and AJAX and unsure how. I basically want to see if I can print out the JSON object, the parse an element out of it later (id) but I'm unsure how to print my entire JSON object to the console.
var results = "";
var movieTitle = "Scary Movie"
$.ajax("https://api.themoviedb.org/3/search/movie?api_key=<<MYAPIKEY>>&query="+movieTitle,function(data){
results = JSON.parse(data);
});
console.log(JSON.stringify(results));
All I get when I log that is empty string.
Any help?