私有方法: function OuterFoo() { this.Name = 'Outer Name'; function InnerFoo() { var Name = 'Inner Name'; alert(Name+", "+this.Name); } } InnerFoo()即为私有方法. 公共方法: function OuterFoo() { this.Name = 'Outer Name'; } OuterFoo.prototype.InnerFoo=function(){ var Name = 'Inner Name'; alert(Name+", "+this.Name); }; 此InnerFoo()为公共方法. 特权方法: function OuterFoo() { this.Name = 'Outer Name'; this.InnerFoo=function() { var Name = 'Inner Name'; alert(Name+", "+this.Name); } } 此InnerFoo()为特权方法. 静态方法: function OuterFoo() { this.Name = 'Outer Name'; } OuterFoo.InnerFoo=function(){ var Name = 'Inner Name'; alert(Name+", "+new OuterFoo().Name); }; 此InnerFoo()为静态方法.