I am working on a project02 where I am learning how to code a search engine with GIPHY using API. I have completed the preliminary code using JQUERY. AJAX() Methods. the API should retrieve on gifs based on user input, however I what I get is CORB error. I have no idea how to fix this
can anyone help?
please see the code below
HTML ------------------------------
Image-Cafe
Search
--------------------- Javascript code using JQUERY
$('#submit').on('click',function(){
var userInput = $('#userInput').val();
console.log(userInput);
$.ajax({
url: `https://api.giphy.com/v1/gifs/search?api_key=Lub7MmeHO52T5aVFbQ3OPrjQjjUua3Rl&q=${userInput}&limit=2&offset=0&rating=g&lang=en`,
dataType: 'JSON',
type: 'GET',
data: {userInput:userInput},
cache: false,
success: function(response){
$.each(response.data,function(index,elm){
console.log(elm.title)
console.log(elm.url)
$("#imgSection").append(`
`)
})
}, error:function() {
console.log("We could not find it")
}
})
})
------------------- This is an image of the console
see attached
your input is greatly appreciate it
Thank you so much!!