惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

博客园 - Sameen

上下文工程学习笔记 什么是vibe ? 什么是 embedding ? angular中asObservable是什么的,为什么需要用? vscode问题 document cookie JavaScript中的Date squash merge Element.scrollIntoView requestIdleCallback angular学习笔记 [转]React hooks useEffect中如何使用异步函数(即如何使用async/await) css斜条纹背景——linear-gradient 【转】过滤不可见字符 换电脑快捷同步vscode插件和配置 Git自动补全配置安装(Mac版本) Mac上看不到.git目录下的隐藏文件的解决方法 ts 问号点 ?. moment获取本月、上个月、近三个月时间段
iframe优缺点
Sameen · 2021-04-23 · via 博客园 - Sameen

优缺点

优点

  1. 可以跨域请求其他网站,并将网站完整展示出来
  2. 典型系统结构可以提高代码的复用性
  3. 创建一个全新的独立的宿主环境,可以隔离或者访问原生接口及对象
  4. 模块分离,若多个页面引用同一个iframe,则便于修改操作
  5. 实现广告展示的一个解决方案
  6. 若需要刷新iframe则只需要刷新框架内,不需要刷新整个页面

缺点

  1. iframes阻塞页面加载,影响网页加载速度,iframe加载完毕后才会触发window.onload事件,动态设置src可解决这个问题。
  2. 加载了新页面,增加了cssjs文件的请求,即额外增加了HTTP请求,增加了服务器负担。
  3. 有时iframe由于页面挤占空间的原因出现滚动条,造成布局混乱。
  4. 不利于SEO,搜索引擎的爬虫无法解读iframe的页面。
  5. 有些小型的移动设备如手机等无法完全显示框架,兼容性较差。
  6. iframe与主页面是共享链接池的,若iframe加载时用光了链接池,则会造成主页面加载阻塞。

posted @ 2021-04-23 14:21  Sameen  阅读(1064)  评论(0)    收藏  举报

刷新页面返回顶部