摘要:
htmlheadtitle新羿集团/title/headscript type='text/javascript' function People() { this.age=9; //obj是对象直接量,在对象直接量中使用this关键字,this引用的不是调用对象,而是实例化的对象,和new Fun()的函数Fun里面this引用的需要实例化的对象一样 var obj={SetAge:function(num){this.age=num;},GetAge:function(){return this.age;}}; obj.SetAge(99); alert(ob 阅读全文
摘要:
此文转自:http://blog.csdn.net/xkyle/archive/2008/11/25/3368597.aspx//没有返回值functionTest0(){this.name='test0';}vartest0=newTest0;//debugger;alert(test0);//输出[Object]alert(test0.name);//输出test0//return一个字符串对象functionTest(){this.name='test';returnnewString('123');//返回字符 串对象}vartest=newTest();alert(test);//输 阅读全文