<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
<!--
function Human()
{
this.i=3;
}
function test()
{
alert(Human.i+",1");
alert(new Human().i+",2");
alert(ff.test1+",3");
alert(ff.test2+",4");
alert(ff.test3+",5");
}
//用alert(Human.i)居然访问不到
//而 alert(new Human().i)则可以
function f()
{
this.test1=1;
}
f.test2=2;
f.prototype.test3=3;
ff= new f();
//-->
</SCRIPT>
</HEAD>
<BODY>
<script>test()</script>
</BODY>
</HTML>
结果 alert(1,3)取不到值
posted on 2008-06-13 20:56
crazy 阅读(134)
评论(0) 编辑 收藏 所属分类:
javasrcipt