I am following his tutorial here: https://www.youtube.com/watch?v=dRZxQY2RgUA
Now when i do nearly the exact same, i am having trouble getting the articles from Wikipedia api. If you check my console when you type in something and pres steh search icon, instead of console.log() the first article, link and description (
sucess: function (data) {
console.log(data[1][0]);
console.log([2][0]);
console.log([3][0]);
},
It activates the error message:
error: function(error) {
alert("error");
}
And i get errors in my console. It is able to search Wikipedia for all the articles
(output: https://en.wikipedia.org/w/api.php?action=opensearch&search=Hello&format=json&callback=?)
Yet it wont let me access it when i get the error:
Failed to load https://en.wikipedia.org/w/api.php?action=opensearch&search=Hello&format=json&callback=?: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://s.codepen.io' is therefore not allowed access.
send @ jquery.min.js:1234:
and
jquery.min.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
and
bootstrap.min.js:6 Uncaught Error: Bootstrap dropdown require Popper.js (https://popper.js.org)
at bootstrap.min.js:6
at bootstrap.min.js:6
at bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6
(anonymous) @ bootstrap.min.js:6
Can anyone help?