As someone who is new to web development, I have encountered an issue. When I tried to input the following link
https://api.locu.com/v1_0/venue/search/?name=jimmy%20johns&api_key=b1f51f4ae241770f72fca5924d045733c4135412
into my browser, I was able to see the JSON object but struggled with using it in my JavaScript code. Despite attempting to utilize JQuery's $.getJSON
, I couldn't get it to work.
EDIT
Fortunately, after some experimentation, I found a solution by using JSONP. By adding &jsonp=readJSON&?callback=? to the URL, I successfully retrieved the JSON data I needed. A big thank you to everyone who provided helpful insights.
$.getJSON( "https://api.locu.com/v1_0/venue/search/?name=jimmy%20johns&api_key=b1f51f4ae241770f72fca5924d045733c4135412&jsonp=readJSON&?callback=?", function() {
console.log( "success" );
})
function readJSON(response){
console.log (response);
}