Firefox 4 iframe 问题
我在使用 Firefox 时遇到了一些奇怪的 iframe 问题。我正在使用4.0.1。
我正在嵌入一个 gcal。这是代码
<iframe src="https://www.google.com/calendar/embed?showTitle=0&showNav=0&showDate=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0&mode=AGENDA&height=400&wkst=1&bgcolor=%23FFFFFF&src=oliversong%40comcast.net&color=%23182C57&ctz=America%2FNew_York" style=" border-width:0 " width="500" height="400" frameborder="0" scrolling="no"></iframe>
,这个 gcal 在 Chrome 和 Opera 中完美运行,只是在 Firefox 中根本不显示。 html 根本没有被调用,它只是显示一个带有空和元素的空 iframe。
有趣的是,如果我连续放置两个相同的 iframe,第二个 iframe 将正确显示。
我尝试这样做
<iframe style="display:none"></iframe>
<iframe src="https://www.google.com/calendar/embed?showTitle=0&showNav=0&showDate=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0&mode=AGENDA&height=400&wkst=1&bgcolor=%23FFFFFF&src=oliversong%40comcast.net&color=%23182C57&ctz=America%2FNew_York" style=" border-width:0 " width="500" height="400" frameborder="0" scrolling="no"></iframe>
,令我大吃一惊的是,这正是我想要的。
不过,这真是太有趣了,我不想就这样了。
为什么 IFRAME 在 Firefox 中不起作用?
//编辑
另一件事:iframe 在谷歌页面上正确显示,它们为您提供要嵌入的代码。
这让我相信我自己的网站是问题所在,但我不知道为什么会出现这种情况,因为我没有针对 iframe 或包含它的 div 的 css 或 javascript。它也没有解释为什么它只发生在 Firefox 中。我还尝试刷新缓存并清除 cookie 和所有内容。
I'm having some weird iframe problems with firefox. I'm using 4.0.1.
I'm embedding a gcal. Here's the code
<iframe src="https://www.google.com/calendar/embed?showTitle=0&showNav=0&showDate=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0&mode=AGENDA&height=400&wkst=1&bgcolor=%23FFFFFF&src=oliversong%40comcast.net&color=%23182C57&ctz=America%2FNew_York" style=" border-width:0 " width="500" height="400" frameborder="0" scrolling="no"></iframe>
And this gcal works perfectly in chrome and opera, just doesn't display at all in firefox. The html isn't called at all, and it just displays an empty iframe with empty and elements.
Funny thing is if I put two of the same iframe consecutively, the second iframe will appear correctly.
I tried doing
<iframe style="display:none"></iframe>
<iframe src="https://www.google.com/calendar/embed?showTitle=0&showNav=0&showDate=0&showPrint=0&showTabs=0&showCalendars=0&showTz=0&mode=AGENDA&height=400&wkst=1&bgcolor=%23FFFFFF&src=oliversong%40comcast.net&color=%23182C57&ctz=America%2FNew_York" style=" border-width:0 " width="500" height="400" frameborder="0" scrolling="no"></iframe>
and to my utter suprise this does what I want it to.
This is super juke-y though and I don't want to leave it at that.
WHY DOESN'T IFRAME WORK IN FIREFOX?
//edit
Another thing: the iframe appears correctly on the google page, where they provide you with the code to embed.
That leads me to believe that my own site is the problem, but I have no idea why that would be the case, because I have no css or javascript targeting iframes or the div containing it. It also doesn't explain why it only happens in firefox. I also tried flushing the cache and clearing cookies and everything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要转义&符号(
&
)。不转义它们可能意味着 URL 被误读。You need to escape your ampersands (
&
). Leave them unescaped could mean the URL is being misread.