1 function WebFXTreeAbstractNode() {
2 alert(2);
3 this.books = "123456";
4 }
5
6 function person(firstname,lastname,age,eyecolor)
7 {
8 this.firstname=firstname
9 this.lastname=lastname
10 this.age=age
11 this.eyecolor=eyecolor
12 }
13 person.prototype = new WebFXTreeAbstractNode;
14 person.prototype.toString = function(){
15 return this.firstname + " 的年龄是 " + this.age + " 岁。" + this.books+" is books ";
16 }
17
18 var myFather=new person("John","Adams",35,"black");
19
20 document.write(myFather);
21