I want to get data from a URL
When I hit this url in POSTMAN using Get type, i get JSON data, but when I hit it with an AJAX call, I get this issue
Failed to load https://api.binance.com/api/v1/ticker/24hr: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://api.binance.com/api/v1/ticker/24hr with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
This is my code
$.get( "https://api.binance.com/api/v1/ticker/24hr", function( data ) {
console.log(data);
});
If need be, I can also change my $.get
to $.ajax
. That won't be an issue.