Why are HTML frames bad?

后端 未结 6 950
孤城傲影
孤城傲影 2021-01-17 13:33

I know they are, but my co-worker doesn\'t believe me. He keeps telling me that Google crawls the inside content and caches it just fine. According to Google, it does crawl

6条回答
  •  甜味超标
    2021-01-17 14:06

    IFrames (like HTML tables) are not bad. However, people were abusing them quite a lot, thus giving them the bad name.

    IFrames do represent a good concept - single visual representation of documents coming from different sources, while keeping the DOM trees properly separated and isolated.

    The problem arises when a script in one of the DOM trees needs to access the elements in another tree. Or when people want to reference the document location, which happens to be the URL of the root document, and fail to realize they need to location of the secondary document.

    But the biggest problem with frames is that there are sites that want to encapsulated other sites in frame and trick the user to think they are interacting with the framed site, while in fact interacting with the outer one. This is the primary reason why most websites will employ some form of frame-busting scripts for their login pages.

    Update: It's Friday and we need some fun, so here's the (obligatory) link to Jeff's post on frames-busting-busters-busting... :-)

提交回复
热议问题