摘要: //类对象构造模版,无new访问,类似静态访问var Class = { create: function () { return function () { //initialize初始化 //apply应用变更,可以反复请求 //arguments参数 this.initialize.apply(this, arguments) }; }, //模拟抽象方法,可以随便自己定 Show: function () { }};//模拟继承... 阅读全文
posted @ 2013-09-07 22:22 如梦不是梦 阅读(742) 评论(0) 推荐(1) 编辑
摘要: 直接看js好了,模拟创建一个奥运会function 奥运会Class(主题) { // 删除主题 // delete this.主题; this.主题 = 主题; this.开幕时间; this.闭幕时间; this.公告簿 = ""; //模拟开幕 this.开幕 = function () { this.开幕时间 = "2012年7月28日03时12分(北京时间)"; this.公告薄 = "奥运主题:" + this.主题 + "\n" + "开幕时间:" + this.开幕时间 + &q 阅读全文
posted @ 2013-09-07 11:00 如梦不是梦 阅读(3489) 评论(7) 推荐(1) 编辑