<html>
<head>
<title>焦点定位</title>
<script LANGUAGE="Javascript">
var newWindow = null
function makeNewWindow(){
if (!newWindow || newWindow.closed)
{
newWindow = window.open("","","width=150,height=150");
var newContent = "<html><head><title>新建窗口</title></head>";
newContent += "<body bgColor='blue'><H1>一个新的窗体</H1>";
newContent += "<form><INPUT TYPE='button' VALUE='切换一个新的窗体' onClick='self.opener.focus()'><BR><BR>";
newContent += "<form><INPUT TYPE='button' VALUE='返回上一窗体' onClick='self.blur()'>";
newContent += "</form></body></html>";
newWindow.document.write(newContent);
newWindow.document.close();
}
else
{
newWindow.focus();
}
}
</script>
</head>
<body>
<form>
<INPUT TYPE="button" NAME="newOne" VALUE="打开新窗体" onClick="makeNewWindow()">
</form>
</body>
</html>