Google 地图 api:跨域读取阻止 (CORB) 阻止了跨域响应

Maj*_*eit 8 javascript ajax google-maps

我正在尝试对谷歌地图 API 执行一个简单的 GET 请求,但我的浏览器一直阻止响应。我在控制台中收到以下警告:

跨源读取阻止 (CORB) 阻止了跨源响应https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=address1&destinations=address2&key=api_key与 MIME 类型 application/json。有关更多详细信息,请参阅https://www.chromestatus.com/feature/5629709824032768

为了阅读方便,我审查了地址和 api 密钥。

这是我的 JavaScript 代码:

$.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
  });
Run Code Online (Sandbox Code Playgroud)