javascript - How geocoder.geocode() works? -


My only question is if the browser compares cross domain AJAX request to Google Map API Does not support works to get data.

How does the following code work?

  script type = "text / javascript" src = "http://maps.google.com? / Map / API / js sensor = false" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Geocodar = new google.maps.Geocoder (); Geocoder.geocode ({'address': address}, function (result, status) {if (position == google.maps.GeocoderStatus.OK) {}}); & Lt; / Script & gt;   

What does geocoder.geocode internally?

EDIT: OK they include http://maps.gstatic.com/intl/en_us/mapfiles/api-3/9/8/main.js < / Strong>

Can anyone tell me why they are using JSONP in their JS code?

This most likely uses JSONp, i.e. a script from Google server in it Which calls a callback function and passes the answers to that function.

Comments