views:

139

answers:

1

Hi there

Just out of curiosity I was wondering how is it possible for the javascript code to embed google maps communicate with server from outside domain. I know I'm missing out something here. can anyone help?

thanks

A: 

Because it writes an iframe, which then makes a request to google (so the javascript isnt actually loading from outside the domain)

webdestroya
bingo. simple really.
Sky Sanders
Indeed it is +1
webdestroya
@downvoter ... was there a reason for that? This answer is correct, unless you have a better one.
webdestroya
You're wrong. The Google Maps API does not embed anything in an iframe. If you 'embed' a map from maps.google.com you do it as an iframe, but again there is no 'writing of an iframe' and this is different from using the Google Maps API. For more information on how to do bypass the same domain policy check out http://en.wikipedia.org/wiki/JSONP#JSONP
Ossama