<script type="text/javascript">
document.write("<p>可用宽度: ")
document.write(screen.availWidth + "</p>")
document.write("<p>可用高度: ")
document.write(screen.availHeight + "</p>")
function opennew() {
var l = (window.screen.availWidth - 300) / 2;
var t = (window.screen.availHeight - 300) / 2;
window.open('http://www.baidu.com/', '百度一下你就知道', 'scrollbars=yes,resizable=yes,top=' + t + ',left=' + l + ',width=300,height=300');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" value="弹出新窗体" οnclick="opennew()" />
</div>