Javascript实例教程(1) 创建弹出式窗口
资源介绍
下面是具体的代码,你可以将它放置到网页的前面:
<SCRIPT LANGUAGE = "JavaScript">
function CreateWindow()
{
msgWindow=window.open("pop_win.html","displayWindow",
"toolbar=no,width=350,height=400,directories=no,
status=no,scrollbars=yes,resize=no,menubar=no")
}
</SCRIPT>
仔细体会一下这段代码,其实就只用到一个window.open函数,是不是很简单呀!你也许会问:那怎么调用这段代码呢?其实你不用着急,下面马上会给出:
<FORM><INPUT TYPE = "button" VALUE = "创建窗口"
onClick = "CreateWindow()"></FORM>