function A()
{this.name = "A";
}
a = new A();
a.func = function()
{alert(this.name);
}
a.func(); // func只有a对象能够使用。
function A()
{this.name = "A";this.func = function(){alert(this.name);}
}
a = new A();
aa = newA();
a.func(); // A的实例对象共享
aa.func(); // <span style="font-family: Arial, Helvetica, sans-serif;"> A的实例对象共享</span>