在 iframe 中的不同域上托管某些页面会产生奇怪的结果
各位,
我正在开发一个应用程序,该应用程序在 iframe 中托管来自不同站点的某些页面。由于该站点位于不同的网络上,因此系统提示我登录其网络才能显示页面。一切都很好(这个网站的用户将在同一个网络上,所以我不担心他们的登录。)
但是,在不同的页面,同一个应用程序上,我试图用一个做同样的事情来自同一站点的不同页面集。这次,我没有收到登录提示,但确实在 iFrame 中收到了 DNS 错误页面(如果重要的话,我在 IE9 中执行此操作。)如果我在 DNS 错误上单击“返回上一页”页面或右键单击并单击“返回”,应用程序的主页(在不同的网络上)将显示在 iframe 中。之后,尝试在 iframe 中加载所需的页面即可。但我对为什么感到困惑,并且更希望它在我第一次尝试时加载!
我猜测托管页面的安全性(HTTPS)、它们位于不同的网络、iframe 以及可能还有 IE9 的结合以某种方式导致了这种情况。有人有什么想法吗?
谢谢,
安·L。
Folks,
I am working on an app that hosts certain pages from a different site in an iframe. Because the site is on a different network, I get prompted to log into their network in order to show the pages. All that is fine (the users of this site will be on the same network, so I'm not worrying about their logging in.)
However, on a different page, same app, I'm trying to do the same thing with a different set of pages from that same site. This time, I don't get prompted to log in, but do get the DNS Error page in the iFrame (I'm doing this in IE9, if it matters.) If I click "return to previous page" on the DNS Error page or right-click and click Back, the home page of the app (on the different network) appears in the iframe. After that, trying to load the desired page in the iframe works. But I'm baffled as to why and would prefer it load the first time I try it!
I'm guessing that the conjunction of the hosted pages being secure (HTTPS), their being on a different network, the iframe, and possibly also IE9 are somehow causing this. Anybody have any ideas?
Thanks,
Ann L.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您直接访问 iframe 指向的 url,您是否会收到相同的错误或者它是否有效?并确保您转到 iframe 正在查看的页面,而不是您认为它正在查看的页面。在您的流程中的某个时刻,页面可能会为 iframe 生成错误的 url。
另一件事是,可能值得使用 fiddler 检查您的流量,看看这些其他页面是否试图对您进行某种重定向 - 他们可能会检查引荐来源网址,并且不喜欢来自其网络外部或类似的连接。
If you go directly to the url that the iframe is pointing at do you get that same error or does it work? And make sure you go to the page the iframe is looking at and not what you think it is looking at. It may be that at some point in your process the page is generating the wrong url for the iframe.
The other thing is that it may be worth using fiddler to check your traffic to see if these other pages are trying to do some kind of redirect on you - they may be checking referrer and not liking connections from outside their network or similar.