9

I'm trying to perform a simple GET request to the google maps API, but my browser keeps blocking the response. I'm getting the following warning in my console:

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=address1&destinations=address2&key=api_key with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.

I censored the addresses and api key for reading convenience.

This is my JavaScript code:

$.ajax({
    url: https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=address1&destinations=address2&key=api_key,
    type: "GET",
    dataType: 'jsonp',
    cache: false
  });
Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
Majesteit
  • 183
  • 1
  • 9
  • Does this answer your question? [How to use CORS to implement JavaScript Google Places API request](https://stackoverflow.com/questions/42180788/how-to-use-cors-to-implement-javascript-google-places-api-request) – MrUpsidown Jul 24 '23 at 18:09

0 Answers0