繁体   English   中英

谷歌地图API突然停止工作

[英]google maps api suddenly stopped working

情况很糟糕...一切正常,突然googlemaps api停止工作

$('input#find_location_button').on('click', function () {

.... some script to get value of input field and store it in data_to_send.... 
data_to_send['sensor'] = 'false';

   //   alert(JSON.stringify(data_to_send));  this alert shows everything is fine

        $.ajax({
            url: 'http://maps.googleapis.com/maps/api/geocode/json',
            dataType: 'json',
            data: data_to_send,
            type: 'GET',
            success: function (data)
            { alert(data); // nothing ... 
.... proper closing tags ... 

我不知道为什么这个ajax请求突然停止工作...在firbug控制台中什么也没显示...没有请求发布...有什么想法吗?

也许缺少CORS HTTP标头的问题解释了为什么它停止工作。

Google Geocoding Web服务在HTTP标头响应中未包含Access-Control-Allow-Origin:*,因此无法通过javascript跨域访问该服务。 直到上周星期五,该标题才包含在内。

如果那是问题,请开始该问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM