Html IFrame 在 Safari 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14105611/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 04:39:25  来源:igfitidea点击:

IFrame not working in Safari

htmliframewebsafarimobile-safari

提问by Rafael

I have an iframein my web page. It works fine in FF and Chrome but not in Safari (I'm using Safari 6.0)

我的iframe网页中有一个。它在 FF 和 Chrome 中运行良好,但在 Safari 中不起作用(我使用的是 Safari 6.0)

This is my code:

这是我的代码:

<html>  
    <head>  
        <title>Pengower</title>     
    </head>  
    <body>  
        <div id="container">  
            <iframe name="news" id="news"   
                src="http://www.penapplications.net/ImogenApps/?Pengower:CRM:Pengower_News">  
            </iframe>  
       </div><!--end container div-->  
    </body>  
</html>

Funny thing is that, if I access the srcurl and then access the iframepage, then the iframeshows the content properly, but if I just access the iframepage without accessing the srcurl page before, it does not show the content.

有趣的是,如果我访问srcurl 然后访问iframe页面,则iframe正确显示内容,但如果我之前访问iframe页面而没有访问srcurl 页面,则不会显示内容。

Any ideas?

有任何想法吗?

回答by Boaz - Reinstate Monica

The iframeseems to be redirecting to a mediating page (penDummyLogon.aspx)which attempts to automatically submit a form to the final page (main.aspx)and set a cookie.

iframe似乎重定向到一个中介页面(penDummyLogon.aspx)其中尝试自动提交表单到最后一页(main.aspx,并设置一个cookie。

Since this method of setting a cookie seems to have been blocked in the recent Safari versions, the user arrives at the final page without the cookie. main.aspxdoesn't seem to be able to handle the missing cookie, and as a result its expected content doesn't load.

由于这种设置 cookie 的方法在最近的 Safari 版本中似乎已被阻止,因此用户到达最终页面时没有 cookie。main.aspx似乎无法处理丢失的 cookie,因此无法加载其预期内容。

For more about this subject see Does the technique for setting third-party cookies in iframes in Safari still work?and Safari 3rd party cookie iframe trick no longer working?

有关此主题的更多信息,请参阅在 Safari 的 iframe 中设置第三方 cookie 的技术是否仍然有效?Safari 3rd 方 cookie iframe 技巧不再有效?

回答by Ashokbharathi

the third party cookies are not working in safari.but in asp.net you can achieve this by using the cookieless sessions.

第三方 cookie 在 safari.but 中不起作用,但在 asp.net 中,您可以通过使用 cookieless 会话来实现这一点。

for more information refer this link http://msdn.microsoft.com/en-us/library/aa479314.aspx

有关更多信息,请参阅此链接http://msdn.microsoft.com/en-us/library/aa479314.aspx