EDIT: I was able to solve this, thanks for you time
I am trying to make an autocomplete on a search form for youtube videos.
I got the url you can use from here: Youtube API search auto-complete
And I'm using this script (though I don't think it has much to do with the problem I'm having): https://goodies.pixabay.com/javascript/auto-complete/demo.html
code I'm using
var xhr;
new autoComplete({
selector: '.search-box',
source: function(term, response){
try { xhr.abort(); } catch(e){}
xhr = $.getJSON('https://suggestqueries.google.com/complete/search?client=firefox&ds=yt', {
q: term,
dataType: "jsonp"
}, function(data) {
console.log(data)
response(data);
});
}
});
gives me the response:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://suggestqueries.google.com/complete/search?client=firefox&ds=yt&q=test&dataType=jsonp. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Am I just not allowed to do this?