他のフレームに書き込む

parent.フレーム名.document.write()を使い他のフレームに書き込む。
parent.フレーム名.location.href= を使い他のフレームのurlを変更。

●左のフレームに書き込むテキストを入力: ・・・→

●左のフレームに現在時刻を表示 ・・・→

  

Sample Source......................................................................>>>

<SCRIPT language="JavaScript"><!--
function LeftWrite(){
msg = document.form1.txt.value;
parent.left.document.open();
parent.left.document.write(msg);
parent.left.document.close();
}
function NowDate(){
objDate=new Date(); //現在日時を取得
Y=objDate.getFullYear(); //年を取得
M=objDate.getMonth(); //月を取得
D=objDate.getDate(); //日を取得
H=objDate.getHours(); //時間を取得
F=objDate.getMinutes(); //分を取得
we=new Array("日","月","火","水","木","金","土"); //配列を作成
W=we[objDate.getDay()];
//曜日を0〜6の数値で取得し、その数値を配列Indexに割り当てる。
parent.left.document.open();
parent.left.document.write(Y,"年",(M+1),"月",D,"日",H,"時",F,"分",W,"曜日です");
parent.left.document.close();
}
//--></SCRIPT>
</head>
<body>
<form name="form1">
●左のフレームに書き込むテキストを入力:
<input type="text" name="txt" size="40">・・・→
<input type="button" name="bt1" value="左フレームに書き込み" onclick="LeftWrite();">
●左のフレームに現在時刻を表示 ・・・→
<input type="button" name="bt2" value="時刻表示" onclick="NowDate()">
<input type="button" name="bt2" value="左フレームを元に戻す" onclick="parent.left.location.href='../window.htm'">
</form>

(最終更新:12/11/26)
フレーム構成になっています・・・<[ホーム] >> [HTML整理ノート]>