Class Iframe
The iframe element represents a nested browsing context, embedding another HTML page into the current page. It is commonly used to embed external content such as videos, maps, or other web applications. The sandbox attribute can be used to restrict the capabilities of the embedded content for security purposes.
Examples:
The following convenience methods are provided for constructing instances of this bean:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.juneau.bean.html5.HtmlElementMixed
child, children, getChild, getChild, getChild, getChildren, setChildrenMethods inherited from class org.apache.juneau.bean.html5.HtmlElement
accesskey, attr, attrUri, class_, contenteditable, deminimize, dir, getAttr, getAttr, getAttrs, hidden, id, lang, onabort, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, oncuechange, ondblclick, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting, self, setAttrs, spellcheck, style, tabindex, title, toString, translate
-
Constructor Details
-
Method Details
-
height
height attribute.Vertical dimension.
-
name
name attribute.Specifies the name of the iframe. This name can be used as the target for links and forms, allowing content to be loaded into the iframe.
The name should be unique within the document.
- Parameters:
value- The name of the iframe for targeting. Can benull to unset the attribute.- Returns:
- This object.
-
sandbox
sandbox attribute.Specifies security restrictions for the iframe content. Multiple restrictions can be specified as a space-separated list.
Common values:
"allow-scripts" - Allow JavaScript execution"allow-same-origin" - Allow same-origin requests"allow-forms" - Allow form submission"allow-popups" - Allow popup windows"allow-top-navigation" - Allow navigation of top-level browsing context
- Parameters:
value- Security restrictions for the iframe content. Can benull to unset the attribute.- Returns:
- This object.
-
src
src attribute.Address of the resource.
The value can be of any of the following types:
URI,URL,String. Strings must be valid URIs.URIs defined by
UriResolvercan be used for values. -
srcdoc
srcdoc attribute.Specifies the HTML content to be displayed in the iframe. This content is rendered directly within the iframe without requiring a separate HTTP request.
The content should be valid HTML that will be displayed in the iframe.
- Parameters:
value- The HTML content to display in the iframe. Can benull to unset the attribute.- Returns:
- This object.
-
width
width attribute.Horizontal dimension.
-