Wikipedia search--yet another CORS problem

Wikipedia search--yet another CORS problem
0.0 0

#1
if(e.which == 13) {
        var search_text = ($("#search_box").val());
        $.ajax({
          url: "https://en.wikipedia.org/w/api.php",
          type: "GET",
          data: {action: "opensearch",search:search_text, format:"jsonp"},
          success: function(data){
            console.log(JSON.stringify(data));
          }
        });

Getting the typical “No ‘Access-Control-Allow-Origin’ header is present on the requested resource.” error. Any suggestions on resolving it? Have read and searched a lot. Now i’m asking.

I whole-heartedly believe this should be a topic addressed more closely in the FCC curriculum. This single error has been the biggest difficulty in all of my intermediate projects so far.


#2

If you come across this question:

Answer here: Access-Control-Allow-Origin Error

Answer here: https://www.mediawiki.org/wiki/Manual:CORS