javascript - DHTML(windowオブジェクト)
windowオブジェクト
<script type="text/javascript"> // グローバル変数定義時は、windowsの属性として存在する var a = 5; document.write(window.a === a); window.book = "windowのbook属性"; document.write("<br>" + book); </script>
※ 複数のframeがある場合には、複数のwindowがあるので、グローバル変数だとしても自分のwindow内で有効。 関数定義も同じだね。
- alert(), confirm(), prompt()
- close()
- focus(), blur()
- moveBy(), moveTo()
- open()
- print()
- resizeBy(), resizeTo()
- scrollBy(), scrollTo()
- setInterval(), clearInterval()
- setTimeout(), clearTimeout()
属性
- closed : クローズ状態か
- defaultStatus, staus : ブラウザの状態欄
- document : HTML
- frames[] : フレーム
- history : 履歴
- location : HTMLのURL
- name : windowの名前
- navigator : ブラウザ
- parent : frameの親
- screen : ディスプレイ
- self : 自身
- top : frameのtop
<script type="text/javascript"> // 状態欄変更 document.write(window.location + "<br>"); </script>