CORB blocking JSONP GET Request

5k Views Asked by At

Attempting to tap http://www.anagramica.com/api to determine all words that can be made from an inputted word. As expected cross-origin policy does not allow using a normal GET request to receive the JSON data. On the anagramica homepage, JSONP is mentioned. I attempted implementing this below.

<!DOCTYPE html>
<html>
<head>
    <script src="jquery-3.3.1.min.js"></script>
    <title>word play</title>
</head>

<body>
    <h1>Speak A Word</h1>
    <script>
    document.body.onclick = function() {
    $.getJSON("http://www.anagramica.com/all/dog?callback=?",function(json){
    console.log(json);
});
        }   
    </script>

</body> 
</html>

This resulted in the following error.

"Cross-Origin Read Blocking (CORB) blocked cross-origin response http://www.anagramica.com/all/dog?callback=jQuery33106950206857384036_1542003732614&_=1542003732615 with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details."

Relevant posts here: Loading cross-domain endpoint with jQuery AJAX

Make cross-domain ajax JSONP request with jQuery

Wondering why JSONP is not working in this case?

0

There are 0 best solutions below