HTML在一页的两个框架中加载两个url
作为一个想法,它很简单,但我从未尝试过,并尝试使用以下代码:
<html>
<frameset cols="30%,70%">
<frame src="www.google.com" name="frame1">
<frame src="www.yahoo.com" name="frame2">
</frameset>
</html>
示例我尝试加载的是 google.com 和 yahoo.com 在两个不同框架的一个页面中。知道怎么做吗? 谢谢,
it is simple enough as an idea but i never tried it and attempted with the following code:
<html>
<frameset cols="30%,70%">
<frame src="www.google.com" name="frame1">
<frame src="www.yahoo.com" name="frame2">
</frameset>
</html>
example what am trying to load is google.com and yahoo.com in one page in two different frames. Any idea how?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 iframe!
但我同意下面的海报。据我所知,您发布的内容在技术上是正确的并且应该有效......
use iframes!
but i agree with the poster below. what you posted is technically correct and should work, as far as i know...
HTML5 已弃用
frameset
和frame
标记。Google Chrome(广泛使用)等浏览器正在完全切换到 HTML5。
因此,对公共应用程序使用
frameset
和frame
标记是危险的。关于问题:
您尝试加载的页面(即
Yahoo
和Google
的 X-frame-options 不允许这样做)。所以,现在几乎是不可能的。
HTML5 has depreciated the use of
frameset
andframe
tags.Browsers like Google Chrome (which are widely used) are switching completely to HTML5.
Hence, using
frameset
andframe
tags for public apps would be dangerous.About the question:
The pages you are trying to load i.e.
Yahoo
andGoogle
do not allow that by their X-frame-options.So, it is virtually impossible now.
这就是它对你有用......这有什么错误吗?据我看来,这会很好地工作。
查看此 W3C 网站了解更多详细信息:框架
Thats its its will work for you....is there any error in that ? Accorcing to me this will work fine.
Check this W3C site for more details : Frames
这是一个很老的问题,但我相信我已经为你找到了答案。
我相信谷歌和雅虎在其页面上运行某种 JavaScript,检测它们是否正在加载到框架中,如果是,则不显示任何内容。
换句话说,您的代码在技术上是有效的,但雅虎和谷歌明确阻止此操作。
请参阅此 JSfiddle 示例。 Yahoo 和 Google 框架不起作用,但 Craigslist 框架可以。
(请注意,我使用了
iframes
而不是frameset
,但最终结果是相同的。)Quite an old question, but I believe I have the answer for you.
I believe google and yahoo have some sort of JavaScript running on their pages that detects whether they are being loaded in a frame, and if so, do not display any content.
In other words, your code is technically valid, but Yahoo and Google are explicitly preventing this action.
See this JSfiddle example. The Yahoo and Google frames do not work, but the Craigslist one does.
(Note that I used
iframes
rather than aframeset
, but the end result will be the same.)