I need to add the callback to fix the problem explained in this site:
我需要添加回调来修复此站点中解释的问题:
How to fix Loading the Google Maps JavaScript API without a callback is not supported
不支持如何修复在没有回调的情况下加载Google Maps JavaScript API的问题
I have a javascript code to insert a Google Geocoder:
我有一段用于插入Google地理编码器的Java代码:
$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&key=' . $this->getServerApiKey();
$URL=‘https://maps.googleapis.com/maps/api/geocode/json?address=’。$地址。‘&key=’。$This->getServerApiKey();
And need to add the function.prototype as a noop callback to prevent an error.
并且需要将函数.Prototype添加为noop回调以防止错误。
It should be:
它应该是:
https://maps.googleapis.com/maps/api/geocode....../MY_API_KEY&callback=Function.prototype
Https://maps.googleapis.com/maps/api/geocode....../MY_API_KEY&callback=Function.prototype
I am not a js coder and do not get the way to include the callback at the end of a php-generated javascript:
我不是一个js程序员,也不知道如何在php生成的javascript的末尾包含回调:
$address = urlencode($address); $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&key=' . $this->getServerApiKey(); $data = json_decode($this->getUrl($url));
$Address=urlencode($Address);$url=‘https://maps.googleapis.com/maps/api/geocode/json?address=’。$地址。‘&key=’。$this->getServerApiKey();$data=json_decode($this->getUrl($url));
I have tried to insert the callback (&callback=Function.prototype) at the end of the line but in some cases there is no effect at all and in others a page error
我尝试在行尾插入回调(&Callback=Function.Prototype),但在某些情况下根本没有效果,在另一些情况下则出现页面错误
I would thank some help or guide.
我会感谢一些人的帮助或指导。
更多回答
我是一名优秀的程序员,十分优秀!