Issue:
I’m trying to make a JSONP request using ajax, but I’m encountering the below error.
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://nftrade.com/_next/data/_Mat1YwGAWWtzBCNmnbbI/assets/avalanche/0x2cca3a1a45c1b1036d7194cd15a981b8c2f9dee4/2493.json?chainName=avalanche&contractAddress=0x2cca3a1a45c1b1036d7194cd15a981b8c2f9dee4&tokenID=2493&callback=jQuery341041842279918868885_1645936498754&_=1645936498755 with MIME type application/json.
The below URL works when I access the it using a chrome browser:
URL:
This is the response headers that is returned from the browser:
Response Headers
- cache-control: private, no-cache, no-store, max-age=0,
must-revalidate - cf-cache-status: DYNAMIC
- cf-ray: 6e3ec0558e647150-YUL
- content-encoding: gzip
- content-type: application/json
- date: Sun, 27 Feb 2022 04:43:16 GMT
- etag: “10f2-zWjggrplfqo/Q28tqHsMexHhykU”
- expect-ct: max-age=604800,
report-uri=”https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct” - server: cloudflare
- vary: Accept-Encoding
What I’ve tried and attempted:
The below is the code I’m currently using:
function getData() {
$.ajax({
url: `https://nftrade.com/_next/data/_Mat1YwGAWWtzBCNmnbbI/assets/avalanche/0x2cca3a1a45c1b1036d7194cd15a981b8c2f9dee4/2493.json?chainName=avalanche&contractAddress=0x2cca3a1a45c1b1036d7194cd15a981b8c2f9dee4&tokenID=2493`,
type: 'GET',
crossDomain: true,
dataType: "jsonp",
success: function (data) {
console.log(JSON.stringify(data));
},
error: function (data) {
console.log(JSON.stringify(data));
}
})
}
Where am I going wrong? Can someone please shed some light? Thanks in advance.