Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

iframe

Wewnętrzna ramka, która działa bardzo podobnie do elementu iframe z języka HTML. Atrybut src służy do określenia zawartości ramki. Treść ta stanowi osobny dokument. Elementy potomne ramki (iframe) są ignorowane.

Dodatkowe informacje są dostępne w kursie XUL.

Atrybuty
src
Własności
accessible, contentDocument, contentWindow, docShell, webNavigation

Przykłady

<iframe src="table.php" flex="2" id="browserTable" name="table_frame"/>

Wybór adres URL z menu

<menulist oncommand="doNav(this);">
  <menupopup>
    <menuitem label="Mozilla" value="https://mozilla.org" />
    <menuitem label="Slashdot" value="https://slashdot.org"/>
    <menuitem label="Sourceforge" value="https://sf.net" />
    <menuitem label="Freshmeat" value="https://freshmeat.net"/>
  </menupopup>
</menulist>


<iframe id="myFrame" flex="1"/>

<script>
function doNav(obj){
  var url = obj.selectedItem.value;
  // firstChild odpowiada elementowi menupopup
  document.getElementById('myFrame').setAttribute('src', url);
}
</script>

Atrybuty

src
Typ: URL
Adres URL zawartości do wyświetlenia w elemencie.

 

Dziedziczy z elementu XUL
align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width

Własności

accessible
Typ: nsIAccessible
Zwraca obiekt dostępności dla elementu.
contentDocument
Typ: document
Własność tylko do odczytu zawierająca obiekt dokumentu w danym elemencie.


contentWindow
Typ: window
Własność tylko do odczytu zawierająca obiekt okna w elemencie.

docShell
Typ: nsIDocShell
Własność tylko do odczytu zawierająca obiekt nsIDocShell dla dokumentu.
webNavigation
Typ: nsIWebNavigation
Własność tylko do odczytu zawiera obiekt nsIWebNavigation dla dokumentu. Wiele z jego metod może być wywoływanych bezpośrednio na dokumencie; są to takie metody jak goBack i goForward. Zawiera także stałe wczytywania wykorzystywane przez reloadWithFlags i loadURIWithFlags.


Metody

Dziedziczy z elementu XUL
blur, click, doCommand, focus, getElementsByAttribute

Dziedziczy z elementu DOM
addEventListener(), appendChild(), dispatchEvent(), getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getElementsByTagName(), getElementsByTagNameNS(), hasAttribute(), hasAttributeNS(), hasAttributes(), hasChildNodes(), insertBefore(), isSupported(), normalize(), removeAttribute(), removeAttributeNode(), removeAttributeNS(), removeChild(), removeEventListener(), replaceChild(), setAttribute(), setAttributeNode(), setAttributeNodeNS(), setAttributeNS()

Podobne

Interfejsy
nsIAccessibleProvider

Autorzy i etykiety dokumentu

 Autorzy tej strony: teoli, lmorchard, Mgjbot, Marcoos, Ptak82
 Ostatnia aktualizacja: teoli,