开发者

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

开发者 https://www.devze.com 2022-12-28 23:45 出处:网络
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

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

精彩评论

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