2013-10-23 397 views
0

我有一个简单的Flex应用程序,用于测试。我下载“flex-iframe-1.4.6.zip”库并使用这个库,我试图显示一个url。但它不显示网页,而是显示错误:“此内容无法在框架中显示”。flex-iframe错误:此内容无法在框架中显示

<flexiframe:IFrame id="mapIFrame" visible="true" 
    source="http://www.google.com" width="500" height="500" label="Google"/> 

我该如何解决这个问题?

+0

您是否已将参数'wmode =“opaque”'添加到HTML模板中的嵌入中,如[用户指南]中所述(https://github.com/flex-users/flex-iframe/wiki/Users -指南)? – splash

+0

是的,我将它添加到html模板中。但它并没有起作用。 –

+0

您使用哪种浏览器? – splash

回答

1

消息“此内容无法显示在框架中”来自Internet Explorer。

IE8 Security Part VII: ClickJacking Defenses

Web developers can send a HTTP response header named X-FRAME-OPTIONS with HTML pages to restrict how the page may be framed. If the X-FRAME-OPTIONS value contains the token DENY, IE8 will prevent the page from rendering if it will be contained within a frame. If the value contains the token SAMEORIGIN, IE will block rendering only if the origin of the top level-browsing-context is different than the origin of the content containing the X-FRAME-OPTIONS directive.

google.com`s电流响应头包含:X-框架选项:SAMEORIGIN

因此,答案是:你不能在一个iframe使用http://www.google.com

因此,flex-iframe users guide中的示例已过时(上次编辑2年前)。

+0

当我使用Firefox时,它不显示此消息。其实它不显示任何东西,页面保持空白。与铬和safari一样。 –

+1

@SarfrazAhmed所有现代浏览器都会考虑X-Frame-Options响应标题。消息“此内容不能在框架中显示”是IE特定的。其他浏览器如Firefox可能不会显示消息,但只是一个空白的iframe。 – splash

相关问题