开发者

how does google maps javascript bypass the "Same Origin Policy"

Just out of curiosity 开发者_如何学PythonI 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


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

EDIT: Google Maps actually uses JSONP. It loads pages as <script> elements and then that script calls a callback method that has already been defined on your page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜