とほほのJavaScript入門(ドキュメント関連)

HOME > とほほのWWW入門 > とほほのJavaScript入門 > ドキュメント関連
1998年3月1日版

ドキュメント(window.document)

[window.]document (N2/e3)
ドキュメントオブジェクト。

[window.]document.activeElement (e4)
現在フォーカスが当たっているエレメント。

[window.]document.alinkColor (N2/e3)
<BODY ALINK=〜>に対応するクリック中リンクの色。

[window.]document.bgColor (N2/e3)
<BODY BGCOLOR=〜>に対応する背景色。

[window.]document.charset (e4)
キャラクタセット。

[window.]document.cookie (N2/e3)
とほほのCookie入門」を参照。

[window.]document.defaultCharset (e4)
デフォルトのキャラクタセット。

[window.]document.domain (N3/e4)
ドメイン名。例えば www2e.biglobe.ne.jp など。

[window.]document.embeds (N3/e4)
<EMBED>に対応する埋め込みオブジェクトの配列。

[window.]document.expando (e4)
未稿。

[window.]document.fgColor (N2/e3)
<BODY TEXT=〜>に対応する文字色。

[window.]document.formName (N2/e3)
<FORM NAME="〜"> で指定した名前。

[window.]document.lastModified (N2/e3)
このドキュメントが最後に更新された時刻。 Date.parse()で解釈することができる。

[window.]document.linkColor (N2/e3)
<BODY LINK=〜>に対応するリンクの色。

[window.]document.parentWindow (e4)
親のウィンドウオブジェクト。

[window.]document.plugins (N3/e4)
ブラウザに組み込まれているプラグインオブジェクトの配列。 document.plugins[0]で指定する。

[window.]document.readyState (e4)
ページのダウンロード状態。 uninitialized, loading, interactive, complete のいずれかを文字列で返す。

[window.]document.referrer (N2/e3)
このページがどのページからジャンプしてきたか、ジャンプ元のページを示すURL。

[window.]document.selection (e4)
選択中のテキスト。

[window.]document.title (N2/e3)
<TITLE>に対応するこのドキュメントのタイトル。

[window.]document.URL (N2/e3)
このドキュメントのURL。

[window.]document.vlinkColor (N2/e3)
<BODY VLINK=〜>に対応する読込み済みリンクの色。

[window.]document.captureEvents(events) (N4)
指定したイベントの捕獲を開始する。

[window.]document.clear() (e4)
未稿。

[window.]document.close() (N2/e3)
このドキュメントを閉じる。

[window.]document.createElement() (e4)
未稿。

[window.]document.createStyleSheet() (e4)
未稿。

[window.]document.elementFromPoint() (e4)
未稿。

[window.]document.execCommand() (e4)
未稿。

[window.]document.getSelection() (N4)
現在選択されている文字列を得る。

[window.]document.handleEvent(event) (N4)
ドキュメントのイベントハンドラを呼び出す。

[window.]document.open([mimeType[,replace]]) (N2/e3)
ドキュメントを開いて書込み可能にする。

[window.]document.queryCommandEnabled() (e4)
[window.]document.queryCommandIndeterm() (e4)
[window.]document.queryCommandState() (e4)
[window.]document.queryCommandSupported() (e4)
[window.]document.queryCommandText() (e4)
[window.]document.queryCommandValue() (e4)
未稿。

[window.]document.releaseEvents(events) (N4)
指定したイベントの捕獲を停止する。

[window.]document.routeEvents() (N4)
イベントを本来処理するべきモジュールに引き渡す。

[window.]document.showHelp() (e4)
未稿。

[window.]document.write(msg[,msg...]) (N2/e3)
指定したドキュメントに文字列や値を書込む。 書き込みの最後にはdocument.close()でクローズしないと、最後の行が表示されないことがある。

[window.]document.writeln(msg[,msg...]) (N2/e3)
write()と同様だが、最後に改行される点が異なる。 HTMLを書き出す際は改行は無視されるので、<PRE>〜</PRE> などの間で用いると違いが分かる。

アンカー(window.document.anchors)

[window.]document.anchors (N2/e3)
<A NAME=〜>に対応するアンカーオブジェクトの配列。

[window.]document.anchors.length (N2/e3)
<A NAME=〜>に対応するアンカーオブジェクトの配列の個数。

アプレット(window.document.applets)

[window.]document.applets (N3/e4)
<APPLET>に対応するアプレットオブジェクトの配列。

[window.]document.applets.length (N3/e4)
<APPLET>に対応するアプレットオブジェクトの配列の個数。

イメージ(window.document.images)

[window.]document.images (N3/e4)
<IMG>に対応するイメージオブジェクトの配列。

[window.]document.images.length (N3/e4)
<IMG>に対応するイメージオブジェクトの配列の個数。

[window.]document.image (N3/e4)
個々のイメージオブジェクト。次の例のような形式で指定する。
  document.images[0]
  document.images["img1"]

[window.]document.image.border (N3/e4)
<IMG BORDER=n>に対応するボーダーの太さ。

[window.]document.image.complete (N3/e4)
読込みが完了しているかどうか(true|false)。

[window.]document.image.height (N3/e4)
<IMG HEIGHT=n>に対応する高さ。

[window.]document.image.hspace (N3/e4)
<IMG HSPACE=n>に対応する余白の高さ。

[window.]document.image.lowsrc (N3/e4)
<IMG LOWSRC="...">に対応する画像ファイル名。

[window.]document.image.name (N3/e4)
<IMG NAME="...">に対応する名前。

[window.]document.image.src (N3/e4)
<IMG SRC="...">に対応する画像ファイル名。

[window.]document.image.vspace (N3/e4)
<IMG VSPACE=n>に対応する余白の横幅。

[window.]document.image.width (N3/e4)
<IMG WIDTH=n>に対応する横幅。

[window.]document.image.handleEvent(event) (N4)
イメージのイベントハンドラを呼び出す。

Image.prototype.newName (N3/e4)
イメージオブジェクトに新しい属性newNameを定義する。

レイヤ(window.document.layers)

[window.]document.layers (N4)
このドキュメントに含まれるレイヤオブジェクトの配列。

[window.]document.layers.length (N4)
レイヤオブジェクトの個数。

[window.]document.layer (N4)
個々のレイヤオブジェクト。下記のように表す。
    document.layers[0]
    document.layers["layer1"]

[window.]document.layer.above (N4)
<LAYER ABOVE="...">に対応するレイヤ名。

[window.]document.layer.background (N4)
<LAYER BACKGROUND="...">に対応する背景画像。

[window.]document.layer.below (N4)
<LAYER BELOW="...">に対応するレイヤ名。

[window.]document.layer.bgColor (N4)
<LAYER BGCOLOR="...">に対応する背景色。

[window.]document.layer.clip.top (N4)
<LAYER CLIP="...">で指定する上端。

[window.]document.layer.clip.bottom (N4)
<LAYER CLIP="...">で指定する下端。

[window.]document.layer.clip.left (N4)
<LAYER CLIP="...">で指定する左端。

[window.]document.layer.clip.right (N4)
<LAYER CLIP="...">で指定する右端。

[window.]document.layer.clip.height (N4)
<LAYER CLIP="...">で指定した高さ。

[window.]document.layer.clip.width (N4)
<LAYER CLIP="...">で指定した横幅。

[window.]document.layer.document (N4)
このレイヤのドキュメント。

[window.]document.layer.left (N4)
<LAYER LEFT=n>に対応する縦位置。

[window.]document.layer.name (N4)
<LAYER NAME="...">に対応する名前。

[window.]document.layer.pageX (N4)
<LAYER PAGEX=n>に対応する横位置。

[window.]document.layer.pageY (N4)
<LAYER PAGEX=n>に対応する縦位置。

[window.]document.layer.parentLayer (N4)
親レイヤオブジェクト。

[window.]document.layer.siblingAbove (N4)
このレイヤの上部にあるレイヤオブジェクト。

[window.]document.layer.siblingBelow (N4)
このレイヤの下部にあるレイヤオブジェクト。

[window.]document.layer.src (N4)
<LAYER SRC="...">に対応するURL。

[window.]document.layer.top (N4)
<LAYER TOP=n>に対応する横位置。

[window.]document.layer.visibility (N4)
<LAYER VISIBILITY="...">に対応する文字列。 "hide" または "show"。

[window.]document.layer.zIndex (N4)
<LAYER Z-INDEX=n>に対応する深さ。

[window.]document.layer.captureEvents(event) (N4)
指定したイベントの捕獲を開始する。

[window.]document.layer.handleEvent(event) (N4)
レイヤのイベントハンドラを呼び出す。

[window.]document.layer.load(src, width) (N4)
レイヤの中身を書き換える。

[window.]document.layer.moveAbove(layer) (N4)
このレイヤをlayerで指定したレイヤオブジェクトの上に移動する。

[window.]document.layer.moveBelow(layer) (N4)
このレイヤをlayerで指定したレイヤオブジェクトの下に移動する。

[window.]document.layer.moveBy(x, y) (N4)
レイヤの位置を相対的に移動する。

[window.]document.layer.moveTo(x, y) (N4)
レイヤの位置をスクリーン座標のx, yに移動する。

[window.]document.layer.moveToAbsolute(x, y) (N4)
レイヤの位置をページ座標のx, yに移動する。

[window.]document.layer.releaseEvents(event) (N4)
指定したイベントの捕獲を停止する。

[window.]document.layer.resizeBy(x, y) (N4)
レイヤの大きさを相対的に変更する。

[window.]document.layer.resizeTo(x, y) (N4)
レイヤの大きさをx, yにする。

[window.]document.layer.reouteEvent(event) (N4)
未稿。

リンク(window.document.links)

[window.]document.links (N2/e3)
このドキュメントに含まれるリンク(<A HREF="...">〜</A>)オブジェクトの配列。

[window.]document.links.length (N2/e3)
リンクオブジェクトの個数。

[window.]document.link (N2/e3)
個々のリンクオブジェクト。
    document.links[n]

[window.]document.link.hash (N2/e3)
URLの#より後ろの部分。"#Contents"など。

[window.]document.link.host (N2/e3)
URLのホスト名+ポーと番号部分。 "www2e.biglobe.ne.jp:80"など。

[window.]document.link.hostname (N2/e3)
URLのホスト名部分。 "www2e.biglobe.ne.jp"など。

[window.]document.link.href (N2/e3)
URL全体。

[window.]document.link.pathname (N2/e3)
URLのパス名部分。 "/~foo/"など。

[window.]document.link.port (N2/e3)
URLのポーと番号部分。 "80"など。

[window.]document.link.protocol (N2/e3)
URLのプロトコル部分。"http:"など。

[window.]document.link.search (N2/e3)
URLの?より後ろの部分。"?KEY=CGI"など。

[window.]document.link.target (N2/e3)
<A TARGET="...">で指定したターゲット。

[window.]document.link.text (N2/e3)
<A HREF="...">〜</A>の〜に相当する文字列。

[window.]document.link.handleEvent(event) (N4)
リンクのイベントハンドラを呼び出す。

Copyright(C) とほほ ( http://www2e.biglobe.ne.jp/~s-hasei/ )