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

80.[html]iframe有那些缺点? #80

Open
webVueBlog opened this issue Mar 19, 2020 · 1 comment
Open

80.[html]iframe有那些缺点? #80

webVueBlog opened this issue Mar 19, 2020 · 1 comment
Labels
web综合 web综合

Comments

@webVueBlog
Copy link
Member

iframe会阻塞主页面的Onload事件

搜索引擎的检索程序无法解读这种页面,不利于SEO

iframe和主页面共享连接池,而浏览器对相同域的连接有限制,所以会影响页面的并行加载

使用iframe之前需要考虑这两个缺点。如果需要使用iframe,最好是通过javascript动态给iframe添加src属性值,这样可以绕开以上两个问题

@webVueBlog webVueBlog added the web综合 web综合 label Mar 19, 2020
@webVueBlog
Copy link
Member Author

The iframe blocks the Onload event on the home page

Search engine retrieval procedures can not read this kind of page, not conducive to SEO

The iframe and the home page share a connection pool, and the browser has restrictions on connections to the same domain, so this affects the parallel loading of the page

You need to consider these two drawbacks before using an iframe. If you need to use an iframe, it's best to add the SRC attribute value to the iframe dynamically through javascript to get around the above two problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web综合 web综合
Projects
None yet
Development

No branches or pull requests

1 participant