<script>
window.onload = function(){
function Interest(){
var global = this;
global.interestList = function(){
alert('basketball、football、table tennis');
}
}
function Student(){
var global = this;
global.name = 'jQ';
global.age = 20;
Interest.apply(global,arguments);//可见 Student 继承了 Interest 的属性和方法
}
var student = new Student();
}
</script>
2012-02-03 Logs
最新推荐文章于 2022-03-08 15:21:48 发布