Chinaunix首页 | 论坛 | 博客

-

  • 博客访问: 164642
  • 博文数量: 48
  • 博客积分: 2000
  • 博客等级: 大尉
  • 技术积分: 490
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-22 18:51
文章分类

全部博文(48)

文章存档

2010年(23)

2009年(25)

我的朋友

分类: 系统运维

2009-10-26 21:46:54

function Lecture(name,teacher){//类Lecture
    this.name=name;
    this.teacher=teacher;
   }
   Lecture.prototype.display=function(){//Lecture的方法display
    return this.teacher+" teach"+" "+this.name;
   }
   lectures=new Array();
   lectures.push(new Lecture("yuwen","zhangsan"));
   lectures.push(new Lecture("shuxu","lisi"));
   lectures.push(new Lecture("english","wangwu"));
   for(var loopIndex=0;loopIndex< lectures.length; loopIndex++){
    document.write(lectures[loopIndex].display()+"
");
   }
阅读(1197) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~