Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] 3.iframe 框架有那些优缺点? #4

Open
qiilee opened this issue Sep 27, 2019 · 0 comments
Open

[html] 3.iframe 框架有那些优缺点? #4

qiilee opened this issue Sep 27, 2019 · 0 comments
Labels

Comments

@qiilee
Copy link
Member

qiilee commented Sep 27, 2019

答案:

优点:

  • iframe 能够原封不动的把嵌入的网页展现出来。
  • 如果有多个网页引用 iframe,那么你只需要修改 iframe 的内容,就可以实现调用的每一个页面内容的更改,方便快捷。
  • 网页如果为了统一风格,头部和版本都是一样的,就可以写成一个页面,用 iframe 来嵌套,可以增加代码的可重用。
  • 如果遇到加载缓慢的第三方内容如图标和广告,这些问题可以由 iframe 来解决。

缺点:

  • 框架结构中出现各种滚动条
  • iframe 会阻塞主页面的 Onload 事件
  • 搜索引擎的检索程序无法解读这种页面,不利于 SEO
  • iframe 和主页面共享连接池,而浏览器对相同域的连接有限制,所以会影响页面的并行加载。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant