剥生毛豆技巧:一个javascript的问题

来源:百度文库 编辑:中科新闻网 时间:2024/05/03 18:36:14
这个怎末运行不出来啊!总是说因为window为空或不是对象
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title>桌面便条</title>
<script language="javascript">
var Window;
function opennote(topic)
{
newnote=Window.open("","note","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes ,copyhistory=no,width=300,height=200");
doc =newnote.document;
str="<html><head><br><title>"+topic+"</title>";
str+="</head>";
str+="<body>";
str+=topic+"<br>";
str +="</body></html>";
doc.write(str);
doc.close();z
self.window =newnote;
}
function closenote(which)
{
self.window.close ();

}
</script>
</HEAD>
<BODY>
<b>桌面便条</b>
<form name='noteform'>
<input type='button' name='open' value='使用便条'onclick='opennote(noteform.note.value)'>
<input type='button' name='close ' value='关闭便条' onclick='closenote()'>
<input type='text' name='note' size =20>
</from></BODY>
</HTML>

window 是 javascript 内置对象

不能定义为变量

你把window 换个名字 比如说 gnwindow

这样就应该可以了

你的Window是是干什么用的? 改成window.open(....
试试看~~~~
大小写要规范