今回の内容
今回はHTMLでウィンドウ(ポップアップ)を生成する方法を解説します。AlertDialogではなく普通のウィンドウです。
サンプルコード
<!DOCTYPE html>
<html>
<head>
<script language="JavaScript">
function newwindow() {
nwin = window.open("", "Newwindow","width=500,height=480");
nwin.document.open();
nwin.document.write("<html><head>");
nwin.document.write("<title>ウィンドウ</title>");
nwin.document.writeln("<body>");
nwin.document.write("新しいウィンドウです");
nwin.document.write("</body></html>");
nwin.document.close();
}
</script>
<title>
Windowを作成する
</title>
</head>
<body>
<p>
Windowを作成しました
</p>
<input type="button" value="表示" onclick="newwindow()">
</body>
</html>
実行例
HTMLでの偽ウイルスの作り方も今度紹介したいと思います。楽しみにしていてください。
うまくいかなかったらコメントお願いします。
0 件のコメント:
コメントを投稿