Inline frame

from Wikipedia, the free encyclopedia

An inline frame (also iframe [ ˈaɪfɹeɪm ]) is an HTML element that is used to structure websites . It is used to display other web content as independent documents in a defined area of ​​the browser . The element was introduced with the HTML 4.0 specification . Browser support was initially poor. However, inline frames are now supported by almost all web browsers.

The technique is often used to embed content from other providers (e.g. advertising) in a website.

implementation

The "iframe" element is used to integrate an inline frame:

<iframe src="http://www.example.com/" height="100" width="200" name="meiniframe">Alternativtext</iframe>

This defines an inline frame of the specified size in which the file is loaded from the URI in the srcattribute. The name of the inline frame can be namefreely selected in the attribute. It can later be used to specifically address the inline frame for links and in JavaScript programs. JavaScript access to the content of the integrated page is only possible through the same-origin policy if it comes from the same domain as the integrating page.

Example: Wikimedia start page in the inline frame (once normal and once with frameborder = "0" and scrolling = "no")

Browsers that do not display inline frames should display the alternate text instead. The inline frame can be assigned an absolute size (in pixels ) or a relative size in relation to the browser window.

properties

With conventional HTML frames , which are no longer part of the HTML language range , the entire website is set up in a frame structure so that the browser window is completely divided into areas that are composed of external HTML documents. Inline frames, on the other hand, are only embedded in specified areas of an existing HTML document . In contrast to normal frames, the size cannot be changed by the user without additional tools such as JavaScript.

The advantage of inline frames as well as conventional frames is that the browser has to take into account the dimensions, but not the design and loading time of the (I) frame content. Since an (inline) frame enables the content to be loaded in parallel, the surrounding page can be displayed while the frame content is still being loaded.

A document embedded as an inline frame can be scrolled along with the surrounding text. However, inline frames can have their own scroll bars if the size of the embedded document requires it.

Due to the frame technology, only the address of the surrounding page is displayed in the browser address line. This makes it difficult to save the embedded page as a bookmark without the surrounding page.

As a visitor, it is not necessary to recognize when one is leaving the content on one page and entering another, so that the page content can be mistakenly assigned to another source. From the side operator's point of view, this may be desirable.

Inline frames can be used to smuggle in malicious code using cross-site scripting .

Web links