阿不

潜水

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
book = function(name,count) { /* instance property*/ this._pageCount = count; /* closure start*/ var _name = name; //private member /* instance method */ this.getName = function() { return _name; } /* closure end*/ /*private static member*/ _type = "class"; } /* public static member */ book.className = "book"; /* prototype method*/ book.prototype.getCount = function() { return this._pageCount; }; //static method book.getType = function() { //访问静态的私有变量 return _type; } book.getClassName = function() { //访问静态公有访问 return this.className; }
posted on 2006-12-08 13:25  阿不  阅读(1385)  评论(1编辑  收藏  举报