<!DOCTYPE html>
<html>
<head>
<meta charset="utf
<title>批量實現面向對象的實例</title>
<script type="text/javascript">
window
function Person(name
this
this
}
Person
alert(this
};
function extend(parent
function a(){
parent
child
};
for(var i in parent
a
}
for(var i in method){
a
}
return a;
};//參數為父級構造函數
var int = extend(Person
this
}
{
showjob:function(){
alert(this
}
}
);
var oc=new int(
oc
}
</script>
</head>
<body>
<h
<p>開始展示批量實現面向對象的實例</p>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20646.html