JavaScriptで子ウィンドウの情報を取得できるかのテストです。
| 子ウィンドウをTARGETで開く | <a href="win_new.html" target="new_win"> | エラー |
| 子ウィンドウをJavaScriptで開く | nWin = window.open("win_new.html","new_win"); | 取得可 |
| 別サイトの子ウィンドウをJavaScriptで開く | nWin = window.open("サイトURL","new_win"); | エラー |
<script language="javascript">
function open_win() {
nWin = window.open("win_new.html","new_win");
}
function open_win2() {
nWin = window.open("http://guardian.ne.jp/history_Internet.html","new_win");
}
function get_info() {
s = nWin.document.title;
document.form1.win_title.value = s;
s = nWin.document.location.href;
document.form1.win_url.value = s;
}
</script>