<html>
<head>
<head>
<body>
<script language="javascript">
// 构造方法与this关键字
function Person(name, age){
alert(name + ":" + age);
this.age = age;
this.name = name;
this.say = sayFunc;
}
function sayFunc(){
alert(this.name + ":" + this.age);
alert(name + ":" + this.age);
}
var person1 = new Person("王", 22);
//alert(person1.say);
person1.say();
var person2 = new Person("平", 23);
person2.say();
</script>
</body>
</html>