Adding Function.prototype as a noop callback

49 views Asked by At

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

I have a javascript code to insert a Google Geocoder:

$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&key=' . $this->getServerApiKey();

And need to add the function.prototype as a noop callback to prevent an error.

It should be:

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:

$address = urlencode($address); $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . $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

I would thank some help or guide.

0

There are 0 answers