【问题标题】:IFrame not working in SafariIFrame 在 Safari 中不起作用
【发布时间】:2012-12-15 20:23:44
【问题描述】:

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

这是我的代码:

<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>

有趣的是,如果我访问src url 然后访问iframe 页面,那么iframe 会正确显示内容,但如果我只是访问iframe 页面而不访问@987654327 @url 之前的页面,不显示内容。

有什么想法吗?

【问题讨论】:

    标签: html iframe web safari mobile-safari


    【解决方案1】:

    iframe 似乎正在重定向到 mediating page (penDummyLogon.aspx),它试图自动向 final page (main.aspx) 提交表单并设置 cookie。

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

    有关此主题的更多信息,请参阅 Does the technique for setting third-party cookies in iframes in Safari still work?Safari 3rd party cookie iframe trick no longer working?

    【讨论】:

    • Google Chrome 的开发者工具 (Ctrl+Shift+J) 在“网络”标签下提供了页面生成的 http 请求的便捷日志。此外,您可以在页面的源代码 (Ctrl+U) 中查看该表单。至于cookies,通常可以在浏览器的隐私设置中看到。例如,在 Google Chrome cookie 中可以找到这个设置页面:chrome://chrome/settings/cookies
    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 2018-01-07
      • 2021-10-18
      • 1970-01-01
      • 2020-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-23
      • 1970-01-01
      相关资源
      最近更新 更多