弹出窗口代码出错,高手请指教!

来源:百度知道 编辑:UC知道 时间:2024/05/13 10:54:39
<html>
<head>
<SCRIPT LANGUAGE="java script">
function openwin()
{
OpenWindow=window.open("msg.ASP","newwin","height=250,width=250,toolbar=no,menubar=no";);
//写成一行
OpenWindow.document.write("<TITLE>例子</TITLE>" ;)
OpenWindow.document.write("<BODY BGCOLOR=#FFFFFF>" ;)
OpenWindow.document.write("<H1>Hello!</h1>" ;)
OpenWindow.document.write("New window opened!" ;)
OpenWindow.document.write("</BODY >" ;)
OpenWindow.document.write("</HTML>" ;)
OpenWindow.document.close()
}
</script>
</head>
<body>
<a href="#" onClick="openwin()">打开一个窗口</a>
<input type="button" onClick="openwin()" value="打开窗口">
</body>
</html>

<SCRIPT LANGUAGE="javascript">
function openwin()
{
OpenWindow=window.open("about:blank","newwin","height=250,width=250,toolbar=no");
//写成一行
OpenWindow.document.open();
OpenWindow.document.write("<html>");
OpenWindow.document.write("<TITLE>例子</TITLE>" ;)
OpenWindow.document.write("<BODY BGCOLOR=#FFFFFF>" ;)
OpenWindow.document.write("<H1>Hello!</h1>" ) ;
OpenWindow.document.write("New window opened!" ) ;
OpenWindow.document.write("</BODY >" ) ;
OpenWindow.document.write("</HTML>" ) ;
OpenWindow.document.close();
}
</script>
</head>
<body>
<a href="#" onClick="openwin()">打开一个窗口</a>
<input type="button" onClick="openwin()" value="打开窗口"&g