stop
ブラウザの読み込み停止ボタンと同等の動きをするメソッド
説明
- ブラウザの読み込み停止ボタンと同じ動きをするメソッド。
- FirefoxやOperaは対応しているが,Safari,Internet Explorerなどには未対応。
用例
ボタンフォーム「停止ボタンのウインドウ」のクリックで開いたウインドウにあるボタンフォーム「'読み込み停止」をクリックしたとき,元のウインドウが読み込み中であれば,その読み込みを中止する。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>stop</title>
<script type="text/javascript">
<!--
function NewWin(){
var NW;
NW=window.open("","NewWin1","toolbar=no,location=no,
directories=no,Width=400,Height=200");
NW.document.open();
NW.document.write("<html><head><title>opener_stop</title>");
NW.document.write("</head>");
NW.document.write("<body>");
NW.document.write("元ウインドウの読み込みを停止");
NW.document.write("<br>");
NW.document.write("<form>");
NW.document.write("<input type='button' value='読み込み停止'
onClick='window.opener.stop();'>");
NW.document.write("</form>");
NW.document.write("</body>");
NW.document.write("</html>");
NW.document.close();
}
//-->
</script>
<style type="text/css">
<!--
body { background-color: #ffffff; }
-->
</style>
</head>
<body>
*ブラウザの読み込み停止ボタン
<br>
元ウインドウ
<p>
<form>
<input type="button" value="停止ボタンのウインドウ"
onClick="NewWin()">
</form>
</p>
</body></html>
この用例を実行する
関連項目
----->documentオブジェクト/open・closeメソッド
----->windowオブジェクト/openerプロパティ