<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 閱讀(147)
評論(0) 編輯 收藏 所屬分類:
javasrcipt