【发布时间】:2013-03-13 15:01:35
【问题描述】:
我遇到了一个奇怪的问题,我不知道问题是什么。以下 jQuery 代码是我想要实现的简化版本:
var iframe = $('<iframe />');
iframe.prop('src', 'https://maps.google.com/maps?q=London&hl=en&sll=37.0625,-95.677068&sspn=46.677964,93.076172&t=h&hnear=London,+United+Kingdom&z=10');
iframe.appendTo($('body'));
// When the iframe loads:
iframe.load(function() {
alert(1);
});
地图永远不会加载,load() 事件也永远不会触发。 Chrome 报告以下错误:
Refused to display 'https://maps.google.com/maps?q=London&hl=en&sll=37.0625,-95.677068&sspn=46.677964,93.076172&t=h&hnear=London,+United+Kingdom&z=10' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
如何绕过这个?
【问题讨论】:
标签: javascript jquery google-maps