Hi everyone!
I´m struggling with the Wikipedia viewer project for some time, have searched and tried various modifications, but nothing helped. Can you help me please?
(Please ignore the missing css - I´m always doing the css as the last thing, after the whole thing works. )
Another question is regarding the "$(document).ready(function() " - if I put it there (wrap all my JS code into this function), the page doesn´t load at all. Why?
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://en.wikipedia.org/w/api.php?action=opensearch&search=magic&format=json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Luckily for the Wikipedia API, the fix is as easy as adding origin=* in the URL parameters.
You might have a syntax error. The last brace should be followed by a closing parenthesis and a semicolon.
$(document).ready(function() {
// ...
});
Off-topic, but you should load bootstrap.js after you’ve loaded jquery.