Skip to content

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

Open
@webVueBlog

Description

@webVueBlog

iframe会阻塞主页面的Onload事件

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

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

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

Activity

webVueBlog

webVueBlog commented on Mar 19, 2020

@webVueBlog
MemberAuthor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @webVueBlog

        Issue actions

          80.[html]iframe有那些缺点? · Issue #80 · weekCodeing/interview-answe