<script type="text/javascript">
function test(name,age){
this.name=name;
this.age=age;
}
test.prototype={
init:function(){
alert(this.name);
}
}
new test('张三',name).init();
</script>
function test(name,age){
this.name=name;
this.age=age;
}
test.prototype={
init:function(){
alert(this.name);
}
}
new test('张三',name).init();
</script>