點擊按鈕創(chuàng)建窗口
主要是使用 window 是對象的 open()方法來創(chuàng)建和調(diào)用其他窗口。
1.制作用于點擊按鈕打開的窗口廣告頁面
<pre name="code" class="html"><html>
<head>
<title>打開新窗口顯示廣告信息</title>
<style type="text/css">
body{
background-image:url(new.jpg);
background-repeat:no-repeat;
}
</style>
</head>
<body></body>
</html>
2.實現(xiàn)創(chuàng)建窗口功能的 index.html
<html>
<head>
<title>通過按鈕打開窗口</title>
<script type="text/jscript" language="javascript">
function pp()
{
window.open("new.html","new","height=280,width=800,top=10,left=20,resizable=no, location=no",false);
}
</script>
</head>
<body>
<form name = "from1" method = "post" action="">
<input type = "button" name = "Button" value= "創(chuàng)建新窗口" onClick = "pp()"/>
</form>
</body>
</html>