<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">
function Dog( name , age , bark){
this.name = name ;
this.age = age ;
this.bark = bark ;
this.info = function(){
return this.name + "的年龄为:" + this.age + ".他的叫声:" + this.bark ;
}
}
var dog = new Dog("旺财",3,'汪汪...');
alert(dog.info());
function Cat(name ,age ,bark){
this.name = name ;
this.age = age ;
this.bark = bark ;
}
var cat = new Cat('kitty',2,'喵..');
var tt = dog.info;
alert(tt.call(cat));
</script>
</HEAD>
<BODY>
</BODY>
</HTML>