<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>打开用户定制窗口</title>
</head>
<body>
<form>
请定制你要显示的窗口:<br />窗口的大小:
<input type="text" name="width0" size="5">宽度
<input type="text" name="height0" size="5">高度<br />是否需要:
<input type="checkbox" name="ck" value="0">菜单栏
<input type="checkbox" name="ck" value="1">工具栏
<input type="checkbox" name="ck" value="2">滚动条
<input type="checkbox" name="ck" value="3">状态栏<br />状态栏的文本:
<input type="text" name="message"><br /><br />
<input type="button" value="打开定制的新窗口" onclick="fun()">
</form>
<script>
function fun(){
alert(1);
var w=document.myform.width0.value;
var h=document.myform.height0.value;
var menu=0;
var tool=0;
var sc=0;
var st=0;
var mes='';
if(document.myform.ck[0].checked){
menu[1];
}
if(document.myform.ck[1].checked){
tool[1];
}
if(document.myform.ck[2].checked){
sc[1];
}
if(document.myform.ck[3].checked){
st[1];
}
mes=document.myform.message.value;
var con='width='+w+',heigth='+h+',menuBar='+menu+',toolBar='+tool;
scrollBars=sc+',status='+st;
var newWin=window.open('new_file.html','new',con);
newWin.status=mes;
}
</script>
</body>
</html>