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

HTMLの iframe 要素と似た機能を持つ内側のフレームです。src 属性はフレームの内容を指定するために使用されます。この内容は別のドキュメントです。iframe の子要素は無視されます。

詳しい情報は XULチュートリアルにあります。

属性
showcaret, src, type
プロパティ
accessibleType, contentDocument, contentWindow, docShell, webNavigation

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

メニューから URL を選択する

<menulist oncommand="doNav(this);">
  <menupopup>
    <menuitem label="Mozilla" value="https://mozilla-japan.org" />
    <menuitem label="Slashdot" value="https://slashdot.jp"/>
    <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;
  // note the firstChild is the menupopup element
  document.getElementById('myFrame').setAttribute('src', url);
}
</script>

属性

showcaret
型: 論理型
コンテンツ領域に文字入力のキャレットを表示するかどうかを設定します。デフォルト値は false です。
src
型: URL
要素内に表示するコンテンツの URL。
type
型: 下記の値のいずれか一つ
browser 内に読み込まれたドキュメントのアクセスを設定するための browser の形式。これが設定されていない場合、読み込まれたドキュメントは browser を含む window と同じアクセスを持ちます。
  • content: コンテンツのためのブラウザ。browser 内に読み込まれたコンテンツは chrome より上位へのアクセスが許可されていません。
  • content-primary: コンテンツのための一次ブラウザ。browser 内に読み込まれたコンテンツは chrome より上位へのアクセスが許可されません。つまり、ウェブブラウザ内では、これはウェブページを表示する要素になります。一次コンテンツの window は、window.content を使用して取得すると便利です。
  • content-targetable: コンテンツのための多くの中の 1 つのブラウザ。browser 内に読み込まれたコンテンツは chrome より上位へのアクセスが許可されていません。この値は、同等の特権を持つ複数の browser を使用するアプリケーション内の、そのとき選択されていない任意の browser 要素よりも優先されます。

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

プロパティ

accessibleType
型: 整数型
要素の accessibility オブジェクトの種類を示す値。
contentDocument
型: document
この読み取り専用のプロパティは要素内の document オブジェクトを含みます。
contentWindow
型: window
この読み取り専用のプロパティは要素内の window オブジェクトを含みます。
docShell
型: nsIDocShell
この読み取り専用のプロパティは document の nsIDocShell オブジェクトを含みます。
webNavigation
型: nsIWebNavigation
この読み取り専用のプロパティは document の nsIWebNavigation オブジェクトを含みます。このメソッドのほとんどは、goBackgoForward のように要素自身から直接呼び出せます。また、reloadWithFlags および loadURIWithFlags によって使用される読み込み定数を含みます。

メソッド

関連項目

インタフェース
nsIAccessibleProvider

ドキュメントのタグと貢献者

 このページの貢献者: Marsf, Yukichi
 最終更新者: Marsf,