当我尝试在 lightbox iframe 中访问 google 地图时,我遇到不安全的 JavaScript 尝试使用 URL 访问框架
当我尝试在 lightbox iframe 中访问 google 地图时,出现不安全的 JavaScript 尝试访问具有 URL 域、协议和端口必须匹配的框架。
我的代码是
<a href="#inline_demo86871" rel="prettyPhoto[inline]" onclick="response_map(86871)"><strong>Map It</strong></a>
这里我使用漂亮的照片作为弹出灯箱取决于response_map id,它会在弹出窗口中加载谷歌地图。
一切都工作正常但是。当我尝试通过单击锚标记加载地图时,出现错误。
Unsafe JavaScript attempt to access frame with URL http://mysite.com from frame with URL http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=address&output=embed. Domains, protocols and ports must match.
when i 'm trying to access google map in lightbox iframe i'm getting Unsafe JavaScript attempt to access frame with URL Domains, protocols and ports must match.
my code is
<a href="#inline_demo86871" rel="prettyPhoto[inline]" onclick="response_map(86871)"><strong>Map It</strong></a>
Here i'm using pretty photo for popup lightbox depends on response_map id it loads the google map on popup.
everythng is working fine but. i'm getting the error when i'm trying to load map by clicking the anchor tag.
Unsafe JavaScript attempt to access frame with URL http://mysite.com from frame with URL http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=address&output=embed. Domains, protocols and ports must match.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您阅读该教程: http://www.no-margin-for-errors.com/blog/2010/09/28/tutorial-opening-custom-content-in-prettyphoto/
它将帮助你了解如何在 PrettyPhoto 中打开自定义内容(Google 地图)。
希望有帮助。
I suggest you read that tutorial: http://www.no-margin-for-errors.com/blog/2010/09/28/tutorial-opening-custom-content-in-prettyphoto/
It will help you figure out how to open custom content (Google Maps) in prettyPhoto.
Hope it helps.
Google 禁用了使用 iframe 访问其网站的功能(请参阅 http://tech.slashdot.org/story/11/10/23/1949227/google-not-reciprocating-on-iframe-usage)
Google disabled the ability to access it's sites using an iframes (See http://tech.slashdot.org/story/11/10/23/1949227/google-not-reciprocating-on-iframe-usage)