<html>
<head>
<SCRIPT LANGUAGE="java script">
function openwin()
{
OpenWindow=window.open("","newwin","height=250,width=250,toolbar=no,scrollbars="+scroll+",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> 请问为什么用不了呢?我在funciton里加了个alert 也不出来 好像就根本进不去啊 谢谢!
<head>
<SCRIPT LANGUAGE="java script">
function openwin()
{
OpenWindow=window.open("","newwin","height=250,width=250,toolbar=no,scrollbars="+scroll+",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> 请问为什么用不了呢?我在funciton里加了个alert 也不出来 好像就根本进不去啊 谢谢!
function openwin()
{ OpenWindow=window.open("","newwin","height=250,width=250,toolbar=no,scrollbars="+scroll+",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="打开窗口">
<SCRIPT LANGUAGE="java script">
改成:
<script language="javascript" type="text/javascript"> 2.把每句话后面的;去了,写到括号外面
OpenWindow.document.write("<TITLE>例子</TITLE>" ;)
OpenWindow.document.write("<TITLE>例子</TITLE>");